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

AddChild/RemoveChild Problem

New Here ,
Apr 24, 2011 Apr 24, 2011

Copy link to clipboard

Copied

I'm using FlashBuilder4 (set to Flex 3.5SDK for compatibility) and am running into an issue with RemoveChild/AddChild.

I have a TabNavigator component with several tabs, each tab utilizing a canvas as its child component.

What I'd like to do is to be able to click a button and have one of the tabs, say the first (index 0) inaccessbile, then to make it accessible upon clicking another button. My first thought was to disable the canvas for the first tab, but I don't see a property for that (i.e. no tabnavigator1.getChildAt(0).enabled property). But I DO see a "visible" property; unfortunately, doing a "tabnavigator1.getChildAt(0).visible = false" in the button's click handler doesn't seem to work. So I settled on removeChild. Clicking the first button calls a handler with "tabnavigator1.removeChild(canvas0)", where canvas0 is the child of the first tab, works fine. Unfortunately, to restore the child I use, in the clickhandler of the SECOND button, "tabnavigator1.addChildAt(canvas0,0);tabnavigator1.selectedIndex = 0" and this does cause the first tab to be selected BUT THE CONTENTS OF THE PREVIOUSLY DISPLAYED TAB OVERWRITE CANVAS0 (sorry for shouting, just wanted to emphasize).

The above seems to be an issue (for me at least) with addChild, since when I started playing with the new way FlashBuilder handles states, using Add/Remove Child, I would see the same type of behavior; i.e. one tab's contents overwriting another's.

Has anyone run into this issue (I've searched and don't see anything)? Failing that, any ideas what might be going on and what to do to correct/workaround this issue?

Thanks.

Views

640

Translate

Translate

Report

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
Guest
Apr 24, 2011 Apr 24, 2011

Copy link to clipboard

Copied

LATEST

Hi, You may want to try posting this query to the Flex SDK forums to get a faster response.

Votes

Translate

Translate

Report

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