PDA

View Full Version : duplicate movie clip depth



FlashFish
September 4th, 2007, 08:41 AM
Mushi mushi.

I'm using this code


onClipEvent(enterFrame){
i++;
duplicateMovieClip(_root.star,"star"+i,i);
_root.counter=i;
}

and what I think that's doing is placing each new clip it creates on a new level above the one before it. It's caused a problem as I have other stuff in my movie that I need to stay above these movie clips, and at the moment it's getting bumped to the bottom.

Anyone have any ideas as to how I can keep these generated movieclips below my content, or maybe go the other way and push my content above the movie clips?

Thanks in advance.

<"))))><

Kosko
September 4th, 2007, 09:35 AM
onClipEvent(enterFrame){
i++;
duplicateMovieClip(_root.star,"star"+i,i);
_root.myContent_mc.switchDepths(_root["star"+i]);
_root.counter=i;
}

try this, i didnt test it....

FlashFish
September 4th, 2007, 12:25 PM
Nice! It didn't work straight away, but I swapped switchDepths to swapDepths and that's cracked it. Cheers!

Kosko
September 4th, 2007, 04:36 PM
right,its swapDepths not switchDepth ;)