AS3 Loading and Displaying an External SWF File


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



Copy this code and paste it in your HTML
  1. var ldr:Loader = new Loader();
  2. ldr.load(new URLRequest("toLoad.swf"));
  3. ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, loaded, false, 0, true);
  4. function loaded(event:Event):void {
  5. addChild(event.target.content);
  6. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.