开发者

How do I change a states click event dynamically in actionScript

开发者 https://www.devze.com 2023-03-31 12:14 出处:网络
<s:Button id=\"btnNext\" label=\"Next\" width=\"80\" click.Title=\"changeState(\'Info\');\" click.Info=\"changeState(\'Organ\');\"
<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

精彩评论

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