1 person found this helpful
Just to be clear, this is really about Flex rather than anything particular to AIR. But it's a good question.
You can definitely define each "form" in a separate file. The most common approach is to create each one as an MXML "composite component." (While it's called a component, you base your "component" on a container so in my mind it's really more of a logical group of several controls -- like a screen or form -- than a "component" in the sense of a single user interface control.)
Once you create an MXML component, you can create an instance of it an another MXML document just by using the tag for it. (If you've done any ASP.NET, it's pretty much the same as ASP.NET composite components i.e. .ascx files.)
You can then for example include your form "components" in a view stack (so you just have a list of tags, each representing one form, rather than needing to include the entire code for every form in one MXML file). Alternately, if they're always replacing each other you can just have a container placeholder defining where the form will go, and just use addChild() and removeChild() to manage which form is visible at any given time. (That's essentially what the ViewStack does -- it just adds extra functionality but also extra overhead, so it depends on what your needs are.)
Some resources to learn more about this:
MXML Custom Components in the Flex 3 Developer's Guide
from the Flex Getting Started Experience: Customizing components: Composite Component
Thanks Paul. It's really helpfull and detailed. love that.
thanks a lot.