Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Removing all clips from the stage 1

Status
Not open for further replies.

voodoojon

Technical User
Dec 18, 2003
107
GB
Hi,

Has anyone got a function that will remove all movieclips from the stage (except for the stage itself that is). I just want to kill all the blocks and characters from my game after completing each level.

Thanks in advance!

Jon

One day I will find a signature worthy of this space. That day has not yet come.
 
Attached.

I just need a way of cycling through all the clips in memory.

Jon

One day I will find a signature worthy of this space. That day has not yet come.
 
Maybe try something like this...
Code:
function removeAllClips(clip) {
clip.removeMovieClip();
for (var i in clip) {
if(typeof clip[i]=="movieclip") {
if(clip[i]!=clip) {
removeAllClips(clip[i]);
}
}
}
};

// Usage...
removeAllClips(_level0);

Regards. Affiliate Program - Web Hosting - Web Design
After 25,000 posts, banned on FK, but proud not to have bowed down to them!
 
cheers!

Jon

One day I will find a signature worthy of this space. That day has not yet come.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top