Load External SWF


/ Published in: ActionScript 3
Save to your folder(s)



Copy this code and paste it in your HTML
  1. import flash.events.Event;
  2. import flash.display.Loader;
  3. import flash.net.URLRequest;
  4.  
  5. var swfLoader:Loader = new Loader();
  6.  
  7. holderMC.addChild(swfLoader);
  8.  
  9. var bgURL:URLRequest = new URLRequest("loadSWF_File.swf");
  10.  
  11. swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadProdComplete);
  12.  
  13. swfLoader.load(bgURL);
  14.  
  15. function loadProdComplete(e:Event):void
  16. {
  17.  
  18. trace(“file loaded”);
  19.  
  20. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.