I have a game written in AS3 on top of Adobe AIR. Now that I've found a publisher for the game, I need to load an external swf to display advertisements (cpmstar). Unfortunately it hasn't been straightforward, and I can't seem to get any advertisements to display on the stage. I'm wondering if I'm doing something wrong. Here's my code:
Security.allowDomain("server.cpmstar.com");
var cpmstarViewSWFUrl:String = "http://server.cpmstar.com/adviewas3.swf";
var cpmstarLoader:Loader = new Loader();
var allowSWF:LoaderContext = new LoaderContext( false, ApplicationDomain.currentDomain, null );
allowSWF.allowCodeImport = true;
var urlRequest:URLRequest = new URLRequest(cpmstarViewSWFUrl + "?contentspotid="+ < my ID > );
cpmstarLoader.load( urlRequest, allowSWF );
addChild( cpmstarLoader );
With the above, I see the url request successfully complete ( I can also see the 200
success response in Chrome ) , but I never see any content added to my stage. I've also tried, with no success, loading the distant URL with URLLoader
and then reloading it through loadByte
as described here: AIR Loading server hosted swf into same sandbox
If the code above looks okay, could the advertisers swf
file be doing something that isn't allowing it to play nicely with this code? If so, what?
Thanks in advance.