Hii, I\'m tring to load swf file to my flash application from a different server. When i try to load it on flash IDE (crl+enter) everything is working fine, but when i run t
Solution: for Flex 4.x (Currently 4.6) and AS3 in Flash Builder:
import flash.system.SecurityDomain;
import flash.system.ApplicationDomain;
import flash.system.LoaderContext;
var loaderContext:LoaderContext = new LoaderContext();
loaderContext.applicationDomain = ApplicationDomain.currentDomain;
loaderContext.securityDomain = SecurityDomain.currentDomain; // Sets the security
context to resolve Error # 2121
... now load your SWF with
loader.load(new URLRequest(webServerWebURL),loaderContext);
Add your working folder in the Global Security Settings panel. This allows you to load external files from a single SWF in your file system. Its the same if you want a.swf to load b.swf even if they is located in the same folder.
This will allow your SWF to read external files.
This should not be a problem if you upload you SWF to a server though.
Your error is from the external location not having a cross domain file, not you. Check out this tutorial on using a bridge file to communicate with an external api. I used as3 and php in this example. The trick is to maintain control of the cross domain file on your domain.Then let your server communicate with the api.