Ok - I have a class which moves stuff around based on a whole
bunch of parameters. It's a pretty slick class and I use it all the
time. I'm trying to build in another function, however, that I've
run into writers block with. The code is below, and you can find it
The deal is, the class works by creating a movie clip withing
the movie clip that moves around. The innermost movie clip is then
given an onEnterFrame event, and a set of variables such that it
can move it's parent around until it gets where it wants to go...
at which point it deletes itself.
Since there can be multiple interior clips (ie, the movie
clip moving on both the _x and _y properties as in the example)
each interior clip is named uniquely with the parameter it controls
as the last part of the movie clip name. I want the control to tell
the movie clip to stop on a given parameter or just stop
So. basically, i want to use a for( in ) statement or
something like it to cycle through all the movie clips inside the
clip passed to the function, and if the name starts with the right
string and sProperty is undefined, delete it anyway... Hopefully
you get the idea. Any tips?
here's the code for the funciton:
public function end(mcClip:MovieClip, sProperty:String):Void
delete mcClip["destination" + sProperty];
delete mcClip["_mcSwoosh" + sProperty].onEnterFrame;
mcClip["_mcSwoosh" + sProperty].removeMovieClip();