import flash.net.URLRequest;
import flash.display.Loader;
import flash.events.Event;
function loadSwf(swf:String){
var loader:Loader = new Loader();
var request:URLRequest = new URLRequest(swf);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
loader.load(request);
}
function loadComplete(e:Event) {
addChild(e.currentTarget.content);
}
loadSwf("yourswf.swf");
Welcome to my actionscript snippet library!
Actionscript Snips is a small repository of actionscript code that aims to save developers and designers time when developing a website.
Loading An External Swf
Posted by
admin
on Tuesday, July 21, 2009
Labels:
Swf
This code can be used to load an external image or swf.
0 comments:
Post a Comment