MySpace Open Platform

A Place For Developers

Welcome Developers!

in

Welcome!

in

Flex/flash Html and more

Last post 06-08-2009 2:39 PM by rondata. 15 replies.
Page 1 of 2 (16 items) 1 2 Next >
Sort Posts: Previous Next
  • 02-14-2009 9:57 AM

    • mike
    • Top 100 Contributor
    • Joined on 02-08-2009
    • Posts 41

    Flex/flash Html and more

    Hi everybody,

    I'm really excited by the new myspace and opensocial apps.
    I'm really at the begin, I would like to build a simple app.

    I would build a simple app that list myfriends into a box made with flex.
    Although I've been program in c++, php, c#, I've just at the begin into flex and ECMA language.

    By the way I would like, in canvas space,
    make an HTML, for display my banner (in a near future), with display inside this flash app.

    So I know that I know that

    I can retrive friends data by calling from "ExternalInterface" a javascript function, 
    I see that I can upload a swf file, but if I upload a html too.

    There's a way to do that, for example if you look at BuddyPoke I see a html file which display banner, and some javascript function, maybe called from flash, and swf file.

    Thanks

     

    Filed under:
  • 02-17-2009 10:00 AM In reply to

    Re: Flex/flash Html and more

     Hi Mike,

     It is not a problem to have both some javascript/HTML on the canvas as well as a flash object.  

    All you need to do is make sure that you select an app type of HTML/Javascript source for the surface you are using (canvas, home or profile).You can type whatever html/javascript you need, upload the flash file and then just use standard object embed code to embed the flash on the page:

     something like this:

    <div><strong>title text here</strong></div>

    <object allowScriptAccess="always" allowNetworking="all" type="application/x-shockwave-flash" data="http://cache01-wid..455e8937ee1cfd95.swf" src="http://cache01-wid..455e8937ee1cfd95.swf" id="OpenSocialExample" width="100%" height="100%">
    <param name="movie" value="http://cache01-wid..455e8937ee1cfd95.swf " />
    <param name="quality" value="high" />
    <param name="wmode" value="transparent" />
    <param name="src" value="http://cache01-wid..455e8937ee1cfd95.swf" />
    </object>

     You can alsoget more info on how to use the ExternalInterface and embedding javascript within your flash app here:

    http://developer.myspace.com/community/myspace/actionscript.aspx

     

    Hope this helps.

     

    -Justin

     

     

  • 02-18-2009 3:19 AM In reply to

    • mike
    • Top 100 Contributor
    • Joined on 02-08-2009
    • Posts 41

    Re: Flex/flash Html and more

    Hi Justin, thanks for the answer, but my problem is this: I don't understand how to upload flash file into myspace.com, in your example you refer to http://cache01-wid..455e8937ee1cfd95.swf, ok I've see in some source something like cache01.myspacecdn.com/l_ieyr8we348iwghihdgfjdhfj.swf. or something like that. What I would understand is: how to upload to myspace(inline flash?) and mainly how to get the name of flash file. Thanks ;)
  • 02-18-2009 3:34 AM In reply to

    Re: Flex/flash Html and more

    Mike

    It's a bit messy...

    Say in Edit App Source, Canvas - 'Browse' & 'Open' your Flash file which will up load to myspace.

    Go into Show Sample Flash Markup and find the newly uploaded swf name - copy it out and use that.

    Hope that makes some sense

    Eddie 

     

     

  • 02-18-2009 8:04 AM In reply to

    • mike
    • Top 100 Contributor
    • Joined on 02-08-2009
    • Posts 41

    Re: Flex/flash Html and more

     Wow! sorry guys, maybe I was little drunk, I didn't see the button for upload flash swf!
    I'm really sorry by the way really thanks, I can't explain to myself how damn I didn't see!?

    I wonder, once flash is uploaded and published...

    is possible to update flash file. I never tried to publish it

    Thanks again, and to Eddie sorry for the mess but my English is "as is" ;) not so good.

    Bye 

  • 02-18-2009 8:34 AM In reply to

    Re: Flex/flash Html and more

    Ciao Mike

    :) - I was referring to the messy way you have to get the upload swf if you want to use in the HTML/Javascript area [not your English which is fine!] especially if you want to update the swf.

    You can update the swf anytime - but once successfully published the newly changed version is in a dev 'area' for testing and once happy you then need to republish again to go live with the changes

    Edddie

  • 02-19-2009 10:46 AM In reply to

    • mike
    • Top 100 Contributor
    • Joined on 02-08-2009
    • Posts 41

    Re: Flex/flash Html and more

    Ciao Eddie! :)

    Thanks for all, and thanks for the answer of other guys here, but you know, when you first time dive  into new tecnology, sometime is very difficul to start.
    I've read lot of post and I've seen yours and some other posts of Dave, the creator of Buddy Poke, and I really appreciate your answers.

    So thanks again

    Mike 



     

  • 02-20-2009 11:20 AM In reply to

    Re: Flex/flash Html and more

    So it looks as though there is no way to set the security flags correct, as you specify ( e.g., allowScriptAccess="always" allowNetworking="all" , etc) if one just uploads an swf file as 'inline flash' and uses it straight, with no html/javascript wrapper. Is this correct?
  • 02-20-2009 11:31 AM In reply to

    Re: Flex/flash Html and more

    That is correct.   The flags are set as follows:

     

    allownetworking="all"

    allowscriptaccess="never"

    -J
  • 02-20-2009 12:11 PM In reply to

    Re: Flex/flash Html and more

    Thanks; so if there is no way to upload using the 'inline flash' version and set these security permissions in any way using the 'inline flash' option, meaning you can't make any connections with OpenSocial data sources, what role does "inline flash" even play?
  • 03-17-2009 6:16 PM In reply to

    Re: Flex/flash, on-line demo

    OK, I've followed the directions to compile and upload the on-line demo, as described in: http://developer.myspace.com/community/myspace/actionscript.aspx Although the widget appears, and the three different pull down options work, pressing 'submit' does nothing (when I test it from within flex, the fake 'test' person information does pop up). Can you tell me why this is not working?
  • 03-19-2009 9:42 AM In reply to

    Re: Flex/flash, on-line demo

     You need to make a couple of changes to the code to make it work in openSocial0.8. 

    The following code needs to be altered:

     

    <mx:XML id="GetOwnerNameAndIdXML" xmlns="">
        <script1>
        <![CDATA[
        function()
        {
            var os = opensocial.Container.get();
            var dataRequest = os.newDataRequest();
            var param = {};
            param[opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS] = [opensocial.Person.Field.ID,MyOpenSpace.Person.Field.ABOUT,MyOpenSpace.Person.Field.BOOKS];
            var OWNERReq = os.newFetchPersonRequest(opensocial.DataRequest.PersonId.OWNER, param);
            dataRequest.add(OWNERReq);
            dataRequest.send(getResponse);
           
            function getResponse(response)
            {
                var flashobj = document.getElementById('OpenSocialExample');
                var OWNER = response.get(opensocial.DataRequest.PersonId.OWNER).getData();
                var ReturnData =
                {
                    'OWNER_ID' : OWNER.getField(opensocial.Person.Field.ID),
                    'OWNER_NAME' : OWNER.getField(opensocial.Person.Field.NAME),
                }
                flashobj.SetOwner(ReturnData);
            }
        }
        ]]>
        </script1>
    </mx:XML>

      

    To the following:

     

    <mx:XML id="GetOwnerNameAndIdXML" xmlns="">
        <script1>
        <![CDATA[
        function()
        {
            os = opensocial.Container.get();
            dataRequest = os.newDataRequest();
            var param = {};
           
            var OWNERReq = os.newFetchPersonRequest(opensocial.IdSpec.PersonId.OWNER, param);
            dataRequest.add(OWNERReq, "get_owner");
            dataRequest.send(getResponse);
            
            function getResponse(response){
                var flashobj = document.getElementById('OpenSocialExample');
                var OWNER = response.get("get_owner").getData();
               
                var ReturnData = {
                    'OWNER_ID': OWNER.getField(opensocial.Person.Field.ID),
                    'OWNER_NAME': OWNER.getDisplayName(),
                }
               
                flashobj.SetOwner(ReturnData);
            }
        }  
        ]]>
        </script1>
    </mx:XML>

    You should be able to use this template to rewrite the  'GetOwnerNameAndIdXML' node also.

     Also, there is another great app for learning how to program opensocial: 'DEMO OpenSocial v0.8 Editor'

    which can be found at:

    http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=124902

    Let me know if you need anything else.

    -J

  • 03-19-2009 4:35 PM In reply to

    Re: Flex/flash, on-line demo

    Thanks; I made those changes in the OpenSocialExample.mxml file I downloaded, but no change....
    Filed under: , ,
  • 04-02-2009 10:55 AM In reply to

    • Monk
    • Top 500 Contributor
    • Joined on 07-23-2008
    • Posts 16

    Re: Flex/flash, on-line demo

     The most and simplest way is having your JavaScript file andSWF on your server and using externalInterface call.

    It will be a a lot of works for using injecting javascript in to Flex or Flash  AS# because the default setting on myspace is "never";

  • 06-05-2009 12:12 PM In reply to

    • Morph
    • Not Ranked
    • Joined on 06-03-2009
    • Posts 3

    Re: Flex/flash, on-line demo

     If my app requires multiples swfs, how do I do it?

Page 1 of 2 (16 items) 1 2 Next >