A component of a spark panel, for example, can be written as follows
<Panel title="Skinny"> <child components ... /> <controlBarGroup> <child control bar components ... /> </controlBarGroup> </Panel>
And his skin file will handle the layout of contentGroup, controlBarGroup and titleDisplay. Note, however, that the contentGroup is not displayed in the code above and that controlBarGroup accepts mxml child components.
Now say that I want to create a custom component that defines various required and optional design elements, such as 'headerGroup', 'navigationGroup' and 'accountPreferencesGroup'. I would like to write this custom component like this
<MyComp> <headerGroup> <child components .../> </headerGroup> <navigationGroup> <child components .../> </navigationGroup> <accountPreferencesGroup> <child components .../> </accountPreferencesGroup> </MyComp>
The motivation here is that now I can create a couple of different skin files to change the look and layout of these subgroups. When reading the source of the spark panel, there are some calls inside the mx_internal namespace, such as getMXMLContent (), which is a method of the spark group component, but which I do not have access to.
Does the description above make sense? How do I create custom “content groups” in my custom Flex4 component that can use child components of nested mxml? Should I approach this differently?
flex custom-component flex4
swidnikk
source share