lundi 29 février 2016

Unload as2 swf nested inside an as3 container

What I'm trying is unload an as2's swf from and as3's swf containner. So It's running okay when loading the as2 swf from an as3 swf cointainner's button as you can see in the next code:

//AS3 cointainner "AS3Loader_TEST1":

var loader:Loader = new Loader();
loader.load(new URLRequest("AS2animation_TEST1.swf"));
addChild(loader);

// and for solving the pitfall, I tryed this:

var AVM_lc:LocalConnection = new LocalConnection(); 

loader.addEventListener(MouseEvent.CLICK, stopandback);
function stopandback(event:MouseEvent):void {
 AVM_lc.send("AVM2toAVM1", "disappear");

}

//then, into the "AS2animation_TEST1.swf" it's written

var AVM_lc:LocalConnection = new LocalConnection();
AVM_lc.dissapear = function(){
animation_mc.unloadMovie();

}

AVM_lc.connect("AVM2toAVM1");

So, the last script unload a movieclip nested in AS2animation_TEST1.swf at addEventListener dispatched from a mouse click into the as3 containner but that's not the way I'm looking for. So, What do you figure out to unload the whole AS2animation_TEST1.swf

Aucun commentaire:

Enregistrer un commentaire