In ActionScript Use A Container's addChild Function To Add A Component To Your Flex Application
An alternative to using mx:States to add or remove components from your Flex application is to use the Container class addChild (or addChildAt) and removeChild (or removeChildAt) functions. Refer to the Flex 2.0 Language Reference's description of the Container class for complete details.