7 Replies Latest reply on Jun 12, 2009 11:45 AM by garigantua

    Layout cannot handle overlapping elements?

    Marc Speck Level 1

      I have a custom component which elements visually overlap. I want to dynamically change the z-axis of these elements. In Flash Player, this usually means changing DisplayObjectContainer.setChildIndex() of the elements. Is it correct that the current concept of layouts (based on LayoutBase) does not easily allow to change the z-axis of elements? Currently, the z-axis seems (very) hard-wired to the position of the element in the group.


      The quickest hack I've found is applying group.setElementIndex() though this is very expensive.

      Thanks for a confirmation or any better hack,


        • 1. Re: Layout cannot handle overlapping elements?
          David_F57 Level 5

          I think you are confusing displaylist order with displayobject screen coordinates if you want overlapping objects that can have there priority changed (bring 1 object to the front) you can't touch the display depth(z-axis) of any of these objects, overlapping of visual objects is done exactly the same way as it was done before we were given a 3d co-ordinate system in FP10 on the assumption that you don't touch the z-axis.


          If you want to use 3d co-ordinate systems you also have to adjust your programming techniques to suit,  for example if an object is being zooming in on once it has a z-axis less than the object in front change the displaylist index order to match.

          • 2. Re: Layout cannot handle overlapping elements?
            Marc Speck Level 1

            Thanks for the reply David. Sorry if I haven't explained the problem

            clearly enough but I'm not confused. Let's avoid the term "z-axis" as

            you solely attribute it to the flash.geom.Matrix3D of the component. As

            you write it, I want "bring 1 object to the front" (or at least one

            element in front of an other element in a group). This is done with

            DisplayObjectContainer.setChildIndex() and has not much to do with the

            "Flash 3D stuff". It seems that the current implementation of layout in

            Gumbo does not allow this easily. So I only want to know whether this is

            true and if yes, whether it is on the road map.


            • 3. Re: Layout cannot handle overlapping elements?
              CoreyRLucier Adobe Employee

              Have you tried playing with IVisualElement layer property?

              • 4. Re: Layout cannot handle overlapping elements?
                Ely Greenfield

                Hi Marc.  The Spark layouts use child order to determine layout.  That causes a problem since, as you point in, the flash runtime uses child order to determine sibling relative layering.  So in Spark, we've changed the flash player behavior slightly.  Spark layouts determine sibling relative layering by comparing the child's 'layer' properties. If two children have the same value for layer (which by default, they all do, with a value of 0), then they layer in sibling relative order.


                So in short...set the 'layer' property if you want them to order differently than their  order within their parent .



                1 person found this helpful
                • 5. Re: Layout cannot handle overlapping elements?

                  I am having the same issues with layouts and their constaining methods.  For example, if I have a TiledLayout with components, I find that the indexing strongly determines the final layout result, and the only thing I have been able to do is change the indexes as a means of changing z-order, last child being the top z and last element always.  In other words, I can't seem to put the top element (child) as the first index.  I think it means that we are limited to changing the xy coords.  If you find a solution, please post it.  I'm considering using a basic layout and writing the tiling functions myself.  Maybe there is an override solution?

                  • 6. Re: Layout cannot handle overlapping elements?
                    Marc Speck Level 1

                    IVisualElement.layer works like a charm. Thanks for pointing me to the property,


                    • 7. Re: Layout cannot handle overlapping elements?
                      garigantua Level 1

                      Yes, thank you all questions and answers.  The layer property works great.  And to think all the time I wasted playing with swapping layouts.