How can I define custom 'contentGroups' in a custom Flex 4 component?

Posted by swidnikk on Stack Overflow See other posts from Stack Overflow or by swidnikk
Published on 2010-05-12T21:21:19Z Indexed on 2010/05/12 21:24 UTC
Read the original article Hit count: 615

The spark panel component for example can be written like this

And its skin file will handle layout of the contentGroup, controlBarGroup, and titleDisplay. Notice, however that the contentGroup is doesn't appear in the code above and that the controlBarGroup accepts child mxml components.

Now say I want to create a custom component that defines various required and non-required skinparts, such as 'headerGroup', 'navigationGroup', and 'accountPreferencesGroup'. I'd like to write this custom component like this

The motivation here is that I can now create a couple different skin files to change the look and layout of those subgroups. Reading source of the spark panel, there are some calls within the mx_internal namespace such as getMXMLContent() which is a method of the spark group component, but which I have no access to.

Does the description above make sense? How can I create custom 'contentGroups' in my custom Flex4 component that can use nested mxml child components? Should I approach this a different way?

© Stack Overflow or respective owner

Related posts about flex-skins

Related posts about flex4