4/6/2011 11:52:41 PM
Title:
replacing - removing the Stage
hi i am trying to load an external swf on to my site but in the process i want the stage to be removed or replaced with the swf My script is liek this - i dont want to add it as child i want to replace the exisitng movie Which is the main Movie/stage
harta.addEventListener(MouseEvent.CLICK, buttonClick)
function buttonClick(e:MouseEvent):void
{
var loader_mc : Loader = new Loader();
var urlRequest : URLRequest = new URLRequest("Harta e Vogel.swf");
loader_mc.load(urlRequest);
addChild(loader_mc);
}
Rayan
Points: 700
Posts:0
4/7/2011 9:55:08 PM
In AS3 there is no way to replace root ,you can remove the previously loaded objects using
removeChildAt(0)
and then use "addChild()" to add new loaded Movie to root