Subscribe

  • Subscribe  

How to Load a Cross Domain File in AS3

Posted by Jay | May 1, 2008 .

In today’s internet world, web sites are using more catchy and snazzy videos to gain people’s interest and to capture larger market share. In this process site developers are been troubled to check out the stuff from other servers due to security reasons. As usage of cross border data is often a necessity it is therefore prudent to validate it. Thankfully Action Script 3 does this job with ease thus giving the opportunity to the developers to create a link between servers while keeping security intact.

Simply put policy files are basically XML files that essentially grants permission to the flash player to access data from a specified domain necessitating a mandatory display of security dialog. To reduce the loading time default setting leaves policy files unchecked and to ensure flash checks the policy file one needs the checkPolicyFile property to be set as true.

With Action script 3, the procedure is as follows.

//Create an object of Loadercontext which is basically under system class of Flash. 

var content1: LoaderContext = new LoaderContext();//Then to check out secure link checkPolicyFile property can be set to true.

content1. checkPolicyFile = true.

x.load(request, content1);

As this command opens and creates a pathway between two domains .

Then you can use “loadmovienum” function to take the stuff from other server by copying | (.SWF file – movie file(flash)).

loadMovieNum("x.swf", 1); // inserts at level one.

Leave a Comment

If you would like to make a comment, please fill out the form below.


Name

Email

Website

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Comments

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word


Related Posts

3 Comments so far
  1. Olivier  May 23, 2008 5:13 am

    it doesnt work, load doesnt expect more then 1 argument :(

  2. Adobe  January 27, 2011 1:08 am

    I have a new feature request to adobe web site to change this stupid security workflow, please commit to save our lifes :)
    http://bugs.adobe.com/jira/browse/FP-6094

  3. SamDc  April 16, 2012 7:59 am

    Yes you got this argument because in above doesn’t say that the loader isn’t URLLoader but Loader! if you set x:Loader= new Loader(); will works. I have problem to read rss from other domain but this way doesn’t work for xml file or link which shows rss!

<

Direct TV Offers - usdirect has the best directtv deals