I have a Flash piece that duplicates a random number of
MovieClips (using duplicateMovieClip) and randomly places them. You
can see it here:
Trouble is, the duplicated MCs are being placed on top of
other artwork. The duplicates appear on top of the text on the left
side of the page. The original MC which is being duplicated resides
on a layer that is under this text. However, its duplicates are
being placed on top.
See my code attached. I'm not sure how "depth" applies here.
From what I can tell, the only time one refers to "depth" is when
you're duplicating a movie clip, and that movie clips that have not
been duplicated have no way of assigning them depth. I've assigned
the new MCs to have a depth of "itr-100". I'm assuming lower depth
means lower stacking order. However, these duplicated MCs are
clearly appearing on top.
to 'contain' these clips at a particular depth - create an
empty MC at the depth stack (on layer or with code) that you want,
the attach all of these clips to that instance, including the
initial block, if you wish to use duplicate. you could simply use
attachMovie - but this will work also.
additionally, it's not recommended to assign 'negative' depth
values, as these are reserved for the elements within the IDE. in
your situation if you create a 'holder' MC you can begin at 0 and
simply increment upward. all MCs have a z-order as well as the main
also, you can refer to and assign depths to and instance,
using swapDepths(), getDepth(), or getInstanceAtDepth();