views:

24

answers:

1

hi. i load three external swf files into my flash movie, here's the code:

import flash.display.*

var screens:Array = new Array(
    'screens/left.swf',
    'screens/center.swf',
    'screens/right.swf'
);

var loaders:Array = new Array();

function complete_listener(event:Event):void {
    event.target.content.width  = 341;
    event.target.content.scaleY = event.target.content.scaleX;
}

for (var i=0; i<screens.length; i++) {
    loaders[i] = new Loader();
    loaders[i].contentLoaderInfo.addEventListener(Event.COMPLETE, complete_listener);
    var url:URLRequest = new URLRequest(screens[i]);
    loaders[i].load(url);
    loaders[i].x = 341 * i;
    loaders[i].y = 0;
    addChild(loaders[i]);
}

everything works just fine with my three dummy swf's, but when i try to load an swf file that uses some kind of animation (for example a motion tween), the swf isn't displayed any more... is there a way around this? thank you!

A: 

Well i can not understand your problem properly.. But i will advise you one think that put stop() on all three swfs which you are gonna load. Then when they are loaded , you can start your animation then here you go

function complete_listener(event:Event):void

{

event.target.content.width  = 341;
event.target.content.scaleY = event.target.content.scaleX; 
var myLoadedSWF:MovieClip =event.target.content as MovieClip;
myLoadedSWF.play();

}

Try this..

Muhammad Irfan