Both approaches are good, the choice is up to you.
El 14/05/2009, a las 22:19, Mophead12 <email@example.com> escribió:
If I have several different pages, like a login screen, a home
screen, a help screen and so on, how would I define each page? Would
each page be made in an .MXML file and then be linked to a
'main' .mxml file? Or would I create each screen as a module file
and link the modules to the .mxml file?
These great links on Flex architecture best practices will surely begin to answer your question:
As Michael already said, both approaches can and are ok. For more complex structure ( architectural stuff ) you need to learn Design Patterns that could help you a lot in the planning process and how to structure your application so it will be loose coupled and as reusable as possible. Obviously, not every application needs the use of Design Patterns, but it's good to know that they exist and can help you out in many situations.
Personally ( without using Design Patterns ), I'd break the project down into separate MXML components. A componente for each page and I'd connect them in the main MXML file. This would lead to cleaner code and if you write the stuff right then you could achieve some nice reusability too and extensibility.
With best regards,