Flash actionscript 3.0: Import a .swf file in flash using actionscript

Import a .swf file in flash using actionscript

Posted by Sankar.G | Posted in | Posted on 12:31 PM

we can import a SWF file in flash using action script
In AS2.0
code: loadMovieNum("example.swf",0);

it is simple is as2.0 example.swf is a file name & 0 is the level of the file

In AS3.0

code: var ldr:Loader=new Loader();
var urlrequest:URLRequest=new URLRequest("example.swf")
ldr.load(urlrequest);
addChild(ldr);

In as3.0 Loader is used to load a file in flash
urlrequest is used to get the link of the file
addChild is used to add that file to the scene

Comments (0)