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.
+1
A:
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.
www.Flextras.com
2010-08-27 11:42:23
Looks like suitable solution, thank you.
Vadim Smakhtin
2010-08-28 11:25:47