MXML vs ActionScript 3.0
Flex components can be added to an application using MXML or ActionScript 3.0. Both code examples below display the same results.
Components are implicitly initialized when the user runs the application.
Components are created and added to the display though an explicit call to the addControls() function when the user runs the application.
You need to add an initialize listener to the application object to call the function that adds the components (initialize="addControls()").
Both applications render the same even though one adds components using MXML and the other using ActionScript 3.0 code.