# Clearing the stage

**URL:** https://forum.kirupa.com/t/clearing-the-stage/22822
**Category:** flash
**Created:** [June 9, 2003, 10:22am UTC](https://forum.kirupa.com/t/clearing-the-stage/22822 "2003-06-09T10:22:54Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![lbeetles](https://avatars.discourse-cdn.com/v4/letter/l/2bfe46/32.png) [@lbeetles](https://forum.kirupa.com/u/lbeetles)
#### Post date: [June 9, 2003, 10:22am UTC](https://forum.kirupa.com/t/clearing-the-stage/22822/1 "2003-06-09T10:22:54Z")

</div>

I have movies nested in movies, what i want to do is when you click on a button i want it to clear the whole stage and then load a frame.

I know that i could put unload each level on the action for the button, but i was just wondering if there is a short way of doing this with code.

Cheers

-Lee

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [June 9, 2003, 10:35am UTC](https://forum.kirupa.com/t/clearing-the-stage/22822/2 "2003-06-09T10:35:18Z")

</div>

You mean like having an array with the various levels in it, the a for loop to go through and unload each one?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [June 9, 2003, 10:46am UTC](https://forum.kirupa.com/t/clearing-the-stage/22822/3 "2003-06-09T10:46:11Z")

</div>

is that the only way of doing it, by having an array and then when the button i sclick it calls the array.

This way thou i have to find out all the levels all the movies load on and there is quite a few.

Is there any way of some code just to say Stage.clear(); or something like that or am i just wishing it is this simple.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [June 9, 2003, 10:51am UTC](https://forum.kirupa.com/t/clearing-the-stage/22822/4 "2003-06-09T10:51:53Z")

</div>

Not that I’ve ever used, but someone else may be able to give a quicker way.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [June 9, 2003, 10:54am UTC](https://forum.kirupa.com/t/clearing-the-stage/22822/5 "2003-06-09T10:54:35Z")

</div>

cheers for your replies Kit.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [June 9, 2003, 11:53am UTC](https://forum.kirupa.com/t/clearing-the-stage/22822/6 "2003-06-09T11:53:11Z")

</div>

kit,

Could you please post with some example code on how the array would look and the actions for the button to call the array.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [June 9, 2003, 12:01pm UTC](https://forum.kirupa.com/t/clearing-the-stage/22822/7 "2003-06-09T12:01:10Z")

</div>

Now I think about it, you won’t even need the array, just the for loop. So say you have 5 movies loaded, it would be something like (and this won’t be perfect, it’s just out of my head):[AS]on (release) {  
for (count=0; count\<5; count++) {  
unloadMovieNum(count);  
}  
}[/AS] where count is your loop, and 5 the number of movies you have. If the number of movies is changeable, then store that as a variable and call it in the loop.
