How do I programmatically trigger a mx:Button click event?

Posted by knorv on Stack Overflow See other posts from Stack Overflow or by knorv
Published on 2010-06-11T22:09:49Z Indexed on 2010/06/11 22:12 UTC
Read the original article Hit count: 199

Filed under:
|

Consider the following mx:Button:

<mx:Button click="doSomething()" id="myButton"/>

Is there some way to programmatically emulate the user clicking the button?

One obvious way to do it would simply be to call doSomething() which would give the same end result as clicking the button. But I'm specifically looking for ways to emulate the click -- that is something along the lines of myButton.click() (if that should have existed).

© Stack Overflow or respective owner

Related posts about flex

Related posts about actionscript-3