# Questions about levels

**URL:** https://forum.kirupa.com/t/questions-about-levels/12922
**Category:** Uncategorized
**Created:** [February 6, 2003, 5:11am UTC](https://forum.kirupa.com/t/questions-about-levels/12922 "2003-02-06T05:11:10Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![lava](https://avatars.discourse-cdn.com/v4/letter/l/a4c791/32.png) [@lava](https://forum.kirupa.com/u/lava)
#### Post date: [February 6, 2003, 5:11am UTC](https://forum.kirupa.com/t/questions-about-levels/12922/1 "2003-02-06T05:11:10Z")

</div>

Hi… I have some code here… I’m just trying to generate some random circles to move them around as a background.

for(k=0; k\<4; k++) {  
duplicateMovieClip (bubble, “circle” + k, 0);  
}

my question is about the levels… running that code, I only get two circles (the original one, and a new one at level 0)

If i do this, however

for(k=0; k\<4; k++) {  
duplicateMovieClip (bubble, “circle” + k, **k** );  
}

I get 6 circles including the original one. My first question is… why is there a difference in the number of circles? (using the debugger I’m noticing that the second circle that’s made is named “circle3”)

my second question is - I have a navbar that I would like the circles to go behind… however, only the first circle (the bubble movie) does that. How can I make it so that all the circles go behind it?

And a bonus question - do buttons have levels? or is that just for movies? I have some buttons too that I dont want the circles to block.

---

<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: [February 6, 2003, 5:32am UTC](https://forum.kirupa.com/t/questions-about-levels/12922/2 "2003-02-06T05:32:09Z")

</div>

first …

for (k = 0; k \< 4; k ++) {  
duplicateMovieClip (bubble, “circle” + k , **0** )  
}

you’re giving the same depth for every duplicated bubble  
so it’s replaced until circle3 … which remains in the stage [size=1][i think … lol 😛][/size]

second …

**bubble** original movie clip  
**circle0** first duplicated circle  
**circle1** second duplicated circle  
**circle2** third duplicated circle  
**circle3** fourth duplicated circle

grand total = 5 😛

me don’t understand :cyclops:

third …

place your navigation bar in a higher depth using  
[color=red]instanceName.swapDepths (someNumber)[/color]

bonus …

same as third but in a lower depth … ? 😛

hope it helps 🙂

---

<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: [February 6, 2003, 12:27pm UTC](https://forum.kirupa.com/t/questions-about-levels/12922/3 "2003-02-06T12:27:36Z")

</div>

just fyi lavaboy, when dealing with duplicate movie and attachMovie etc, the correct term for that kind of placement/arrangement is “depth” (like kax used) and not level. Normally it wouldnt be a big deal but Flash also deals with levels when using loadMovie/loadMovieNum which are similar but different alltogther - allowing for confusion when working with duplicate etc.

---

<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: [February 6, 2003, 12:46pm UTC](https://forum.kirupa.com/t/questions-about-levels/12922/4 "2003-02-06T12:46:07Z")

</div>

> the correct term for that kind of placement/arrangement is “depth” (like [color=red] **kax** [/color] used) and not level

viva yo !! 😛 😉

---

<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: [February 6, 2003, 3:59pm UTC](https://forum.kirupa.com/t/questions-about-levels/12922/5 "2003-02-06T15:59:12Z")

</div>

hey, thanks, swapdepth worked. I’m still confused about depth though… my script generates a couple of movie, but I want them to go behind preexisting buttons… Are the movies generated by the code in different depths? Can you have two movies in the same depth? Cause I didnt really understand why the movies were getting overwritten as a result of having the same depth.

---

<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: [February 6, 2003, 4:12pm UTC](https://forum.kirupa.com/t/questions-about-levels/12922/6 "2003-02-06T16:12:59Z")

</div>

can you have two movie clips in the same depth ?  
nope …

when you’re talking about movies … you mean movies [size=1][different swfs][/size] or movie clips ?? lol 😛  
if it’s movies then you’re talking about levels  
if it’s movie clips then you’re talking about depths

oh well … you’ve officially confused me now :cyclops:

**senocular** get back here with your explanations !! 😛  
you’re really good at that and i really suck :-\

---

<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: [February 6, 2003, 4:13pm UTC](https://forum.kirupa.com/t/questions-about-levels/12922/7 "2003-02-06T16:13:34Z")

</div>

yeah, its like an array if you are familiar with them if you have an array with three elements:

myArray = new Array(1,2,3);

and you try to put a new element in the second postion of that array

myArray[1] = “a”;

Then you evectively over-write and replace that original element with the new

trace(myArray); // traces 1,a,3

The same thing applies when attaching and duplicating movieclips. Trying to attach a bunch of movies in depth 0 means you are replacing each one of those clips youve previously put there.

swapDepths however, does let you swap movieclips into the same depth once theyve been successfully attached. With this though you sometimes get some flickering if they are overlaping because Flash is confused on how to arrange them on the screen randomly putting one above the other etc.

---

<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: [February 6, 2003, 4:15pm UTC](https://forum.kirupa.com/t/questions-about-levels/12922/8 "2003-02-06T16:15:22Z")

</div>

that was fast dude 😛

thank you very much …

---

<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: [February 6, 2003, 4:17pm UTC](https://forum.kirupa.com/t/questions-about-levels/12922/9 "2003-02-06T16:17:10Z")

</div>

> \*Originally posted by kax \*  
> \*\*that was fast dude 😛

thank you very much … \*\*

haha I started before you posted yours 🙂

---

<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: [February 6, 2003, 4:18pm UTC](https://forum.kirupa.com/t/questions-about-levels/12922/10 "2003-02-06T16:18:48Z")

</div>

yeah i know that … that’s why i was laughing 😏

---

<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: [February 6, 2003, 4:31pm UTC](https://forum.kirupa.com/t/questions-about-levels/12922/11 "2003-02-06T16:31:30Z")

</div>

:!: I thought 😛 was a tongue  
Im missing out on a lot of things, Im feeling dense lately haha

---

<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: [February 6, 2003, 4:37pm UTC](https://forum.kirupa.com/t/questions-about-levels/12922/12 "2003-02-06T16:37:20Z")

</div>

a tongue huh ?? … no idea

but it seems like a laughing smilie to me 🙂

---

<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: [February 6, 2003, 4:51pm UTC](https://forum.kirupa.com/t/questions-about-levels/12922/13 "2003-02-06T16:51:20Z")

</div>

cool… that clarifies stuff… thanks.
