jeudi 29 décembre 2016

load multiple external SWF's to unknown number of movieclips and control them (AS3)

I'm creating a multi-player game that every user can join it. I want to load some assets to every user who going to join, but to be able to control them when user is doing some actions. For example, if the user is going forward, the asset will gotoAndStop at frame number 2.

I know that I can load SWF and control them by creating a variable of movieclip (; but I can't create unknown num of variables.

I have tried to do something like this:

var asset:MovieClip;
var myLoader:Loader = new Loader;
myLoader.load(new URLRequest("Asset_1.swf"));
myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE , onCom);
function onCom(e:Event):void{
    asset = MovieClip(;

but when I'm doing this:


It's giving me an error. What can I do?

Aucun commentaire:

Enregistrer un commentaire