Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

setting z-index upon a panel?

Explorer ,
Oct 04, 2013 Oct 04, 2013

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

TOPICS
ActionScript
1.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Oct 07, 2013 Oct 07, 2013

I found a solution.

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

Thanks for the advice Ned

Translate
LEGEND ,
Oct 04, 2013 Oct 04, 2013

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 04, 2013 Oct 04, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 04, 2013 Oct 04, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 04, 2013 Oct 04, 2013

Thanks for the reply. But temporary reparenting doesn't sound the perfect solution to me as this custom component is to be used by other developers as well.

Is there any other existing popup component that I can use instead of panel?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 07, 2013 Oct 07, 2013

So reparenting is the only way to make a proper popup component in Flex?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 07, 2013 Oct 07, 2013

I found a solution.

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

Thanks for the advice Ned

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 07, 2013 Oct 07, 2013
LATEST

You're welcome

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines