Hi everyone i am working on this code
[as]portfolio_btn.addEventListener(MouseEvent.CLICK, portfolio);
home_btn.addEventListener(MouseEvent.CLICK, home);
var loader:Loader=new Loader();
loader.load(new URLRequest(“portfolio.swf”));
function portfolio(E:Event):void
{
var t:Timer;
if(t==null){
t= new Timer(2000,0);
t.start();
t.addEventListener(TimerEvent.TIMER,addSwf);
function addSwf(e:TimerEvent):void{
addChild(loader);
}
}
}
function home(E:Event):void
{
removeChild(loader);
}
[/as]
so i can click on a button and after 2 seconds my swf loads fine. but then when i click on the other button to unload, remove it. It plays again…
how can i remove it so it doesnt keep adding itself.
Thanks for any help