PDA

View Full Version : duplicateMovieClip (f5)



ericinho
September 8th, 2003, 12:56 PM
Is it possible at all to give the duplicateMovieClip a target MC in which it has to put the duplicates???

i know you can give it a depth, but I want the duplicates to be put into another MC.

jingman
September 8th, 2003, 01:05 PM
I'm assuming this is in refference to your other post?

See, what I would use in your situation is attachMovie and not duplicate. With attachMovie you can easily specify the target MC, and everything works just great.

One thing you would have to change is where you have your AS for the bubble. You should put it inside the MC on the first frame (I'm pretty sure you have to do this with 'attach' because the actions won't be copied over like in duplicate).

So for you, you will put an empty MC behind the bucket, name it 'container', and use


container.attachMovie("bubble","bubble"+_root.depth,_root.depth++);

Where 'bubble' is specified as the linkage identifier for the bubble MC in the library.

ericinho
September 8th, 2003, 03:39 PM
yup, but i found an easier way. I finally understood that with duplicateMovieClip it actually copies a version to a new and higher depth. When I got that point, the solution was rather obvious. Simply put the object that has to overlap the bubbles at a higher depth with SwapDepth.

But in any case, thanks for your help!

Much appreciated :)