3 Replies Latest reply on Oct 11, 2007 5:49 PM by kglad

    how do I set layers

    mrMajk Level 1
      how can i set the layer priority as my action script mc plays over top of my 3d rendered movie
      all help appreciated
        • 1. Re: how do I set layers
          kglad Adobe Community Professional & MVP
          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.
          • 2. Re: how do I set layers
            mrMajk Level 1
            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 ?
            • 3. Re: how do I set layers
              kglad Adobe Community Professional & MVP
              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.