
Untitled
By: a guest on
Jun 30th, 2012 | syntax:
None | size: 0.58 KB | hits: 11 | expires: Never
Calling one MXML from AS code
<mx:Button id="myButton" label="My Button" click="myButton_clickHandler(event)"/>
function myButton_clickHandler(event:Event):void {
var child:Child = new Child();
myVBox.addChild(child);
}
<fx:Script>
<![CDATA[
private function changeState():void {
currentState = (currentState == "default") ? "showVBox" : "default";
}
]]>
</fx:Script>
<s:states>
<s:State name="default" />
<s:State name="showVBox" />
</s:states>
<mx:VBox id="myVBox" includeIn="showVBox" />
<mx:Button label="Show/Hide VBox" click="changeState()" />