Targeting all MC's in an array except orig?

  • torbjorn
  • Novice
  • Novice
  • User avatar
  • Posts: 23

Post 3+ Months Ago

Hi,
I have a movieclip called 'footprints' that is duplicated using duplicateMvieClip, and placed on the stage, over and over again. The clips are named ' '"footprints"+i'
I would like to add a feature where you can delete the prints and start again, but without deleting the original clip.
How do I target all the clips except for the first one, so I can delete them using removeMovieClip?

nm = "footprints"+i;
duplicateMovieClip(_root.footprints, nm, _root.counter++);
The footprints are for a little bug that scoots all over the screen on my portfolio site http://www.neverbeat.com. To turn on the footprints for the bug, go to the 'animation' page and click on 'neverbug' then click the 'footprints' check box. (I have figured out how to stop and start the footprints, but I don't know how to remve them all without deleting the original clip.)
Thanks
t[/code]
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13504
  • Loc: Florida

Post 3+ Months Ago

If _root.counter stays inline with how many clips have been made somthing along theese lines should work.

Code: [ Select ]
function eraseTracks(){
    for(i = 0; i < _root.counter; i++){
        toWipe = ["footprints" + i];
        removeMovieClip(toWipe)
    }
}
  1. function eraseTracks(){
  2.     for(i = 0; i < _root.counter; i++){
  3.         toWipe = ["footprints" + i];
  4.         removeMovieClip(toWipe)
  5.     }
  6. }
  • torbjorn
  • Novice
  • Novice
  • User avatar
  • Posts: 23

Post 3+ Months Ago

Thanks a lot. I got it to work. Check it out if you like
http://www.neverbeat.com/flash/
Click on 'animation' then 'neverbug', then check and uncheck 'footprints'.
Thanks,
t
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13504
  • Loc: Florida

Post 3+ Months Ago

Glad I could help :D very neat.

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 6 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.