Applying states
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:states> <mx:State name="newCheckbox"> <mx:AddChild relativeTo="{vbox}"> <mx:CheckBox id="checkbox" label="New Checkbox" /> </mx:AddChild> </mx:State> </mx:states> <mx:VBox id="vbox"> <mx:Button label="Click" click="currentState='newCheckbox'" /> </mx:VBox> </mx:Application>