<s:Button id="btnNext" label="Next" width="80"
click.Title="changeState('Info');"
click.Info="changeState('Organ');"
/>
How do I dynamically change the "click.Title" event in ac开发者_如何学PythontionScript?
btnNext.addEventListener(MouseEvent.CLICK, ????
Something like the following:
btnNext.addEventListener(MouseEvent.CLICK, onClick);
private function onClick(event:MouseEvent):void
{
switch (currentState)
{
case "Title":
changeState("Info");
break;
case "Info":
changeState("Organ");
break;
}
}
There is no declarative states support in ActionScript.
精彩评论