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

flash actionscript : Clearing the board


Dinghus
4/19/2004 8:28:34 PM
Is there a way to know what MC are on stage and how many?

Like if the user is allowed to create MCs to do whatever on the stage, and
then have a button to clear all. How can I tell how many MCs are out there
without keeping count during creation?
mandingo
4/19/2004 11:29:20 PM
Have you tried something like this:

for(allThoseThings in this){
if(typeof(allThoseThings) == "movieclip"){
trace(" I am a movieClip on " + this);
}
}

that may give you an idea how to apply that to your own use

cheers,
kglad
4/20/2004 1:25:35 AM
just need to clean that code a little mandingo:

for(allThoseThings in this){
if(typeof(this[allThoseThings]) == "movieclip"){
trace(" I am a movieClip on " + this);
this[allThoseThings].removeMovieClip();
}
}
mandingo
4/20/2004 1:53:09 AM
Thanks kglad,

the typeof(this[allThoseThings]) was a typeof == "typo"

the removeMovieClip() was left out intentionally as I wasn't sure if he had
other conditions he wished to also test for...

thanks for picking up for me though.

cheers
AddThis Social Bookmark Button