Skip to main content
Inspiring
October 4, 2013
Answered

setting z-index upon a panel?

  • October 4, 2013
  • 2 replies
  • 1221 views

Hi,

I am making a custom color picker component. Simply, when the user clicks a color box, color palettet should pops up over all other components.

This is my color palette panel:

        <s:Panel width="111" height="215" id="colorPalette"

                 y="18"

                 backgroundColor="0x333333"

                 visible="false"

                 includeInLayout="false"

                 skinClass="com.storefront.image_module.uicomponents.HeaderlessPanelSkin"

                >

            <s:layout>

                <s:TileLayout paddingTop="5" paddingLeft="5" />

            </s:layout>

        </s:Panel>

But everytime I set it's visible=true , it goes unerneath of other components. To fix this problem, I tried several ways I can think of but none of them worked.

What is the best way to make the panel appear over all other components? Im looking for something similar to "z-index" in css

This topic has been closed for replies.
Correct answer 9tontruck

I found a solution.

I warpped the panel with PopUpAnchor and it works exactly what I wanted.

Thanks for the advice Ned

2 replies

9tontruckAuthorCorrect answer
Inspiring
October 7, 2013

I found a solution.

I warpped the panel with PopUpAnchor and it works exactly what I wanted.

Thanks for the advice Ned

Ned Murphy
Legend
October 7, 2013

You're welcome

Ned Murphy
Legend
October 4, 2013

You can use the addChild() method to bring an object to the top of the display list.

9tontruckAuthor
Inspiring
October 4, 2013

I have tried that way too. But it didn't work because the panel's perent component also has next componets so there still exists over-standing components

Ned Murphy
Legend
October 4, 2013

Then you probably need to change the parenting for the panel.  Maybe you could temporarily reparent it to the main timeline then back again when it is dismissed.