MySpace Open Platform

A Place For Developers

Welcome Developers!

in

Welcome!

in

Access OpenSocial data from iFrame

Last post 04-17-2009 8:22 PM by face. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 02-17-2009 9:06 AM

    Access OpenSocial data from iFrame

    Hi,

    Can anyone give me an idea about how you can access the MySpace OpenSocial APi from an iFrame app using flash?

    Every call I make at the moment from my iFrame app generates a security error due to the domain my iFrame app is on not being allowed access to http://api.myspace.com  because of this crossdomain file http://api.myspace.com/crossdomain.xml.

     

  • 02-18-2009 2:29 AM In reply to

    Re: Access OpenSocial data from iFrame

    Not sure exactly how/where you are running your app but you could try creating your own crossdomain.xml for your server

    <cross-domain-policy>
    <allow-access-from domain="*.myspace.com"/>
    <allow-access-from domain="*.myspacecdn.com"/>
    </cross-domain-policy>

    Eddie

  • 02-23-2009 4:24 AM In reply to

    Re: Access OpenSocial data from iFrame

    Eddie - 

     Thanks for the reply but you're misunderstanding cross domain policy files. 

    "A cross-domain policy file is an XML document that grants a web client—such as Adobe Flash Player (though not necessarily limited to it)—permission to handle data across multiple domains. When a client hosts content from a particular source domain and that content makes requests directed towards a domain other than its own, the remote domain would need to host a cross-domain policy file that grants access to the source domain, allowing the client to continue with the transaction."

    So, for example, let's imagine we have an iFrame on a MySpace canvas page that has a test.swf embedded and loaded from a domain called 'test.com'.The problem is that test.swf from test.com has to check the cross domain policy file on myspace.com in order to make a request to myspace.com. If the cross domain policy file on myspace.com doesn't allow calls from 'test.com' a security error event is fired and the call to myspace.com fails. I am having this exact problem too and I'm not sure how you're supposed to get around it.

     Any thoughts from the myspace development team?

     Cheers,

    T

  • 03-30-2009 10:37 AM In reply to

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

    Re: Access OpenSocial data from iFrame

     Here is the work around. I use embed swfObject tag and have swf on my server and using ExternalInterface.call to communicate with OS API javascript layer on iFrame.

  • 04-17-2009 2:00 PM In reply to

    • Chris
    • Top 150 Contributor
    • Joined on 11-13-2008
    • Posts 32

    Re: Access OpenSocial data from iFrame

    You can either host your swf on myspace (use the HTML/Javascript Source app type), or you can do your api calls from javascript and use ExternalInterface in flash to communicate with your javascript code.

  • 04-17-2009 8:22 PM In reply to

    • face
    • Not Ranked
    • Joined on 03-23-2009
    • Posts 4

    Re: Access OpenSocial data from iFrame


Page 1 of 1 (6 items)