This content has been marked as final. Show 3 replies
you can't. layers don't exist outside the authoring environment. upon publication all on-stage objects are assigned a depth (which depends upon the objects layer) and that determines the object's z-ordering.
you can control the depth of movieclips with actionscript (in as2) using swapDepths(). in as3, there's a related way to control z-ordering.
I have read the swapDepths function has been replaced by the setChildIndex?
not quite working for me ( and it could be me )
I have developed a star background ( needs to be refined ) but it plays over top of my plantes which I have added from 3d max
here is the star script : any suggestions on how can I place the stars behind the planets ?
yes, as i mentioned, as3 has other ways of dealing with z-ordering. in you situation, when you add a star to the display list, instead of using addChild(), use addChildAt() to control the z-ordering of your stars.
now, if your planets are also children of "this", you should be ok. if planets are not children of "this", then you will need to alter the index of one of your planet ancestors and one of your start ancestors. those ancestors are the closest (to stars and planets, resp) that where both ancestors have the same parent ancestor.