Managing depth in actinscript3
I have a 3D
field with many MovieClip
s in it, and seems like the one last added is the one that overlaps others and not the one with highest z
value.
z-index
? (sorting childre开发者_如何学JAVAn by z
value seems too much like a hack).
A 3D
engine that can place MovieClip
s will be helpful(but not one that requires custom drawing).
I'm using Flash CS5
with ActionScript 3
You're looking for parent.setChildIndex. You can use that or swapChildren to move the z-index of children around.
flash itself has no z-index sorting with the 3D space, so you have to either pull a completely new 3D engine or sort it manually every frame.
no matter what happens you will always get some problem when trying to overlap two planes on the same z co-ordinate, even in full 3D engines, you have to decide which one you want to be in front of the others or you will get flickering as each frame they change places.
personally i work with Away3D as an engine, and that has the possibilities for 'MovieMaterial' to a plane (which is probably what you are meaning) but it think this is a pretty general use and can be used in Papervision etc. too.
精彩评论