Forum Topic: remove all movieclips (as2)

(70 views • 4 replies)

This topic is 1 page long.

<< < > >>
None

mooseisloose

Reply To Post Reply & Quote

Posted at: 5/28/09 02:17 PM

mooseisloose FAB LEVEL 34

Sign-Up: 12/06/04

Posts: 2,404

at my gameover screen i still have like 50 mcs on stage that wont bugger off. the majority of them dont have instance names, just depths, how do i remove all of them? i know i can remove them one by one or if they were all the same but with a number, but what's the easiest way to remove all mcs on stage, like every single mc?


None

Neo-13

Reply To Post Reply & Quote

Posted at: 5/28/09 02:20 PM

Neo-13 LIGHT LEVEL 20

Sign-Up: 06/09/07

Posts: 1,475

Why not have another frame without them being there in the first place?

BBS Signature

None

Yambanshee

Reply To Post Reply & Quote

Posted at: 5/28/09 02:21 PM

Yambanshee DARK LEVEL 10

Sign-Up: 10/05/08

Posts: 1,448

how did u add them, dynamically? if so use this:
for(i in _root){
removeMovieClip(i)
}
//i have NEVER used for in in my life, so it might not work

AS2||AS3||Motox
Thanks to hdxmike for the sig :]

BBS Signature

None

mooseisloose

Reply To Post Reply & Quote

Posted at: 5/28/09 02:23 PM

mooseisloose FAB LEVEL 34

Sign-Up: 12/06/04

Posts: 2,404

At 5/28/09 02:21 PM, Yambanshee wrote: how did u add them, dynamically? if so use this:
for(i in _root){
removeMovieClip(i)
}
//i have NEVER used for in in my life, so it might not work

thank you that worked PERFECTLY =]


None

Paranoia

Reply To Post Reply & Quote

Posted at: 5/28/09 02:25 PM

Paranoia DARK LEVEL 33

Sign-Up: 04/22/05

Posts: 9,692

At 5/28/09 02:20 PM, Neo-13 wrote: Why not have another frame without them being there in the first place?

Because they're added dynamically, and not attached to the timeline.

You can loop through them, e.g, when you spawn them, add them to an array (as you should anyway), and when they die or it's game over, just remove everything in the array.

My preferred method is to just stick a nest clip on whatever timeline and attach everything to that. That way everything's automatically removed anyway once you hit a frame without the nest.

BBS Signature

All times are Eastern Standard Time (GMT -5) | Current Time: 12:52 PM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!