Tuesday, March 29, 2011

LOADING an EXTERNAL SWF (by button)

var myLoader1:Loader=new Loader ();
squBtn1.addEventListener(MouseEvent.CLICK, swf1content);
function swf1content(myevent1:MouseEvent):void {
var myURL1:URLRequest=new URLRequest("YourMovie.swf");
myLoader1.load(myURL1);
addChild(myLoader1);
}

cirBtn1.addEventListener(MouseEvent.CLICK, unloadSwf1content);
function unloadSwf1content(myevent5:MouseEvent):void {
removeChild(myLoader1);
}

No comments:

Post a Comment