Groups | Blog | Home
all groups > flash actionscript > june 2004 >

flash actionscript : Help with action when 3 movie clips have loaded


Dereenb
6/27/2004 5:00:12 PM
In plain English I'd like to do the following:
When movie clip with instance name X and movie clip with instance name Y and
movie clip with instance name Z are loaded (I have buttons that when clicked
trigger movie clips to load), then go and play next scene.
For the life of me, I don't know how to do this. Help will be much appreciated.
Thank you
kglad
6/27/2004 5:19:38 PM
scenes don't exist outside the authoring environment. so, don't use scene
information in your navigation scheme. label your frames and use frame labels
to navigate your movie. also, you can't load a movieclip with instance name
X, Y and Z. you can load X.swf into a target movieclip, say targetX. you
would then reference targetX to control your loaded movie. for example:

targetX.loadMovie("X.swf");

and after X.swf completes loading you could use:

targetX.gotoAndPlay("scene2frame1");
Dereenb
6/27/2004 6:02:37 PM
Thank you however, I want to be able to have all these movie clips have been
loaded first, then once they've all loaded, I would be able to go to
scene2frame1. Basically, I have 5 buttons... each button when clicked loads a
movie clip into a target movie clip. Once the user clicks all 5 buttons, the
movie progresses to scene 2... see what I mean? I think it should be an "if"
statement....
I hope I make sense!
kglad
6/27/2004 8:34:20 PM
attached to a frame:

myA=new Array();
for(ivar=0;ivar<5;ivar++){
myA[ivar]=0;
}

and attached to your kth button:

on(press){
targetMC.loadMovie("X.swf");
myA[k]=1;
product=1;
for(ivar=0;ivar<5;ivar++){
product *= myA[ivar];
}
if(product==1){
gotoAndPlay("scene2frame1");
}
}
}

AddThis Social Bookmark Button