A common coding practice is to divide an application into functional units, or modules,
where each module performs a discrete task. Dividing your application into modules provides
you with many benefits, including the following:
Ease of development
modules independently of each other.
You can reuse modules in different applications so that you do not have to
Reusability
duplicate your work.
By developing your application in discrete modules, you can isolate and
Maintainability
debug errors faster than you could if you developed your application in a single file.
In Flex, a module corresponds to a custom component, implemented either in MXML or in
ActionScript. The following image shows an example of a Flex application divided into
components:
main.mxml
components
<mx:Application>
<..>
*.MXML
*.AS
Use <mx:Script>
to write, import,
or include
ActionScript
14
Creating Flex Components
Different developers or development groups can develop and debug
Custom
Compiler/Linker
ActionScript
*.AS
*.AS
*.AS
<..>
*.MXML
*.AS
SWC and RSL files
Web server
classes
*.SWF
RSL files
Client