Okay, I have a pause button with a stop action on it. I just recently found out how to target movie clips in order to pause them as well, but I am wondering the best way to assign the action pause all movie clips used in the scene at once.
Do I have to list each one seperately or can I target them all in the same action?
Example:
<hr>
on (release) {
_root.movieclip#1name.stop ();
}
on (release) {
_root.movieclip#2name.stop ();
}
<hr>
OR can I do it like this
<hr>
on (release) {
_root.movieclip#1name,movieclip#2name,movieclip#3name.stop ();
}
<hr>
put an and instead of the comas and make sure to put a space on both sides of it…like on(release) {
+root.movieclip1.stop() and movieclip2.stop();
}
it SHOULD work
Okay thanx guys-
My email wasn’t saying I had any replies so I went ahead and just tried it without checking here first. I ended up doing them
all seperately like my first example.
I have to do it in several places though, so I will probably try the example you gave, crazygamer.
Kax, I don’t really understand the for in loop thing…are you saying that I could just use this one piece of code and it would
take care of stopping all the clips without naming them all?
yep… i just found out this for and while stuff and its really neat… with the for… in statment it will contol all the movie clips in the place you have defined as in… and that all… so its really good… anyway there was a flash beginer trying to sound like an expert… did it work?? doubt it… =p anyway… maybe kax can explain it better…
thank aussie I am an AS beginner too, so I pretty much got what you were saying. Except for this part:
<hr>
you have defined as in
<hr>
what do you mean when you say you have to define them as in?
opps other way round should be “in the place you have deffined in as” which mean that… if u take an example of the code
for(clips in _root){
_root.[clips].stop()
}
if you look the script you see that the “in” is set as the _root which is the main timeline so at the moment the script will seach the maintime line for any movie clips regardless of their names. Then when it has done that the script then regonises them by calling them clips and then tells clips to stop… so what you rename clips to makes no difference as long as its the same in the for statment and infront of the stop() and the only inportant thing is where u have to tell the script to search for movie clips.
Well i read that all out of the flash mx bible for the first time only ½hr ago… so it might not make much sense… so… anyway… hope i helped…
Originally posted by jillymo are you saying that I could just use this one piece of code and it would take care of stopping all the clips without naming them all?
Thanks… glad we could help… and kax youve been using flash for a shorter time than me… your pretty good… anyway… i guess i should get back to increasing my flash skills… so… zya people…
<hr>
put an and instead of the comas and make sure to put a space on both sides of it…like on(release) {
+root.movieclip1.stop() and movieclip2.stop();
}
it SHOULD work
<hr>