Welcome to WebmasterWorld Guest from 54.167.155.147

Forum Moderators: open

Message Too Old, No Replies

loading/unloading external swf (external swf has mx transitions)

   
5:44 am on Jul 6, 2009 (gmt 0)

5+ Year Member



Hello. I'm new to AS, i'm trying to figure out on how to load external swf.

I created a new file which is AS3 (2 buttons on stage) and my external swf's has mx transitions on AS2 (consists of images and thumbnails). I followed this tutorial. [youtube.com ]

The problem is, once I click the buttons (main file) I've created, my external swf's tween won't work anymore as well as with the buttons of that external swf. In short the animation of my external swf became static. But for the initial load of the first external swf, it's working.

I don't know what's the problem. Does this have to do with the AS3 & AS2 conflicts? or something wrong with my code?

Attached here is my code:

var Xpos:Number = 110;
var Ypos:Number = 60;
var swf:MovieClip;
var loader:Loader = new Loader();


var defaultSWF:URLRequest = new URLRequest("swf/vcon_folio_white.swf");


loader.load(defaultSWF);
loader.x = Xpos;
loader.y = Ypos;
addChild(loader);
//////////////////////////////


//Btns Universal Function
function btnClick(event:MouseEvent):void{
removeChild(loader);
var newSWFRequest:URLRequest = new URLRequest("swf/" + event.target.name + ".swf");
loader.load(newSWFRequest);
loader.x = Xpos;
loader.y = Ypos;
addChild(loader);

}

//Btn Listeners
vcon_folio_white.addEventListener(MouseEvent.CLICK, btnClick);
vcon_folio_black.addEventListener(MouseEvent.CLICK, btnClick);

Hope someone can help me here in the community. :(