You modularize mxml by creating
components. Components can be implemented either in Actionscript or in
mxml. Except for the implementation there is no difference. To create an mxml component, create an
mxml file, and instead of using mx:Application as the root tag, use some other
tag, like Hbox, or Panel, or absolutely anything you want. This is identical to saying in AS, “class
MyHBox extends Hbox”. To try this, just cust some mxml text out
of your App, something that is maybe in a viewstack or a tabnavigator. Create a
new mxml file say “MYHbox.mxml” and copy that cut text into it.
Instantiate it in the location you cut it from using <MyHBox height=”100%”
… /> Make sure there is a default namespace in you application tag:
xmlns=”*”. Run the app. You will see your component displayed. Now, it is really a bit more complicated
than that, because you will probably want to pass data in and out of your
component. But get this concept first, then we’ll tackle that. From:
flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of hank williams How do
you modularize MXML. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
YAHOO! GROUPS LINKS
|