0

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.

Community
  • 1
  • 1
Jeff
  • 623
  • 3
  • 8
  • 22
  • I opened your swf URL in a browser and it was blank ! May be you'v forgot some params or something ... in all cases, if you can see nothing in the browser, sure you will see nothing in your AIR app ! – akmozo Oct 16 '15 at 20:31
  • Yes, I was curious about that too. I am concatenating a special unique identifier in the actual URL request: `new URLRequest(cpmstarViewSWFUrl + "?contentspotid="+ < my ID > )`, but even with it, I still see nothing in the browser. – Jeff Oct 16 '15 at 21:24
  • FWIW I've reached out to CPMStar separately in hopes they can give me some insight with respect to the blank pages. – Jeff Oct 16 '15 at 21:30

0 Answers0