Jorge Albaladejo

Hard & Soft design…

Archive for the ‘cross-domain’ tag

ActionScript 3 and cross-domain problem

without comments

One of the most typical problems when coding AS3 to, let’s say, read data from an external XML source, is the cross-domain problem. According to security policies, not an url outside the domain where the AS application is being executed can be read, and different subdomains (such as www.yourdomain.com and yourdomain.com) are considered as different ones.

If the external resources you are trying to use come from your own application in another domain / server that you manage, then it can be fixed by adding a cross-domain policy file. This file must be defined on the content source server, and your AS application has to explicitly declare this server as allowed.

?View Code ACTIONSCRIPT
Security.allowDomain("domainone.com");
Security.allowDomain("domaintwo.com");

 

But if this is not the case and the content source is on a different remote server like, for instance, when implementing an RSS news reader which grabs content from sources like online news sites, then this problem can be worked out with a PHP proxy file.

Read the rest of this entry »

Written by Jorge Albaladejo

September 6th, 2010 at 8:37 pm

This site is protected with Urban Giraffe's plugin 'HTML Purified' and Edward Z. Yang's Powered by HTML Purifier. 6020 items have been purified.