How about having them all use a subclass of MovieClip?
class RemoveableClip extends MovieClip {
public function onPress():Void {
trace(this);
this.removeMovieClip();
}
}
(Then link that class to the symbol.)
On 2/16/07, Mick G <[EMAIL PROTECTED]> wrote:
I have 1000 movieclips on stage and want it so whichever one you click on
gets removed.
At the moment I have a for loop that is assigning:
for(var i=0; i<1000; i++){
this["mc"+i].onPress = function(){
trace(this);
this.removeMovieClip();
}
}
it all works fine, I'm just wondering if anyone can think of anything more
efficient for such a large number of MCs. Like a listener or something?
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
--
T. Michael Keesey
Director of Technology
Exopolis, Inc.
2894 Rowena Avenue Ste. B
Los Angeles, California 90039
--
The Dinosauricon: http://dino.lm.com
Parry & Carney: http://parryandcarney.com
ISPN Forum: http://www.phylonames.org/forum/
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com