0 Replies Latest reply on Jun 12, 2007 12:10 PM by Aaron34589

    determining a UIComponent's "real" visibility

      Dear All,

      In Flex, determining a component's visibility by testing "component.visible==true" is sometimes inaccurate because the component's ancestors might be invisible while the current component's visibility is still true.

      For example, if we have 3 components A, B, and C, arranged in a parent-child relationship: A->B->C, then if I set A.visible=false, both B and C will become invisible on screen because their ancestor is invisible, but B.visible and C.visible are still true.

      So, what's the best way to determine a UIComponent's "real" visibility in Flex? To me, "real" visibility means whether the component is physically drawn on screen.

      The only way I can think of is to recursively scan through the "visible" property of a component's ancestors, If any of its ancestors has "visible==false", then the component's "real" visibility is false.

      Is that the "official" way, or are there any better ways to do it?

      Any suggestions would be greatly appreciated. Thanks!