Skip to main content
JabbyPandaUA
Inspiring
October 5, 2009
Question

Why IVisualElementContainer does not have "getChildren" method defined?

  • October 5, 2009
  • 1 reply
  • 881 views

Hi all,

In Flex 3 SDK Container.as has method getChildren() and rawChildren property typed as IChildList.

But In Flex 4 the interface IVisualElementContainer does not have a definition for getChildren() > thus neither SkinnableContainer nor Group have this method defined.

Was this decision made deliberately to simplify the interface API?

I find it convenient to have "getChildren" method implemented inside Group and SkinnableContainer,  for example this can be useful if I want to access all visual childs of those containers to pass them along to some manager class or to dynamically set some common property of all childs ( e.g visibility).

This topic has been closed for replies.

1 reply

October 5, 2009

MX had a concept of two sets of children: regular children and raw children.  One component could have two children lists.

Spark simplifies this concept because of the skin.  Now there's really only one set of children.  Because of this IVisualElementContainer acts like IChildList and has a very similar API.  You should be able to use IVisualElementContainer as you would IChildList before.

Note that in places where we do have more than one-set of children, we don't expose them on the main object, but require you to dig down in to the separate object (the skin or the controlBarGroup for example).

Hope that helps,

Ryan