开发者

Click Flex 4 spark ToggleButton component in code

I can't found any property in sparks's ToggleButton that allow me to press it from code. I tested setCurrentState("down") method, but this way button not开发者_运维技巧 dispatching click event i think.


You'll have to manually create a click event and dispatch it to simulate a "click in code". Conceptually something like this:

var clickEvent : MouseEvent = new MouseEvent(MouseEvent.CLICK)
this.myButton.dispatchEvent(clickEvent);

If this doesn't switch the toggle state, you may have to do so manually, and your original answer has that code.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜