开发者

How do I change a states click event dynamically in actionScript

<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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜