简体   繁体   English

flex3按钮状态

[英]flex3 button state

I would like to change the state of a flex button component with actionscript (on the fly) to present it as mouse-down/mouse-over/mouse-up, in order to use the css skining with out the existence of the mouse cursor. 我想用动作脚本(快速)更改flex按钮组件的状态,以将其显示为mouse-down / mouse-over / mouse-up,以便在没有鼠标光标存在的情况下使用css外观。 I tried to do this with button.currentState but this doesn't work. 我试图用button.currentState做到这一点,但这是行不通的。

thanks in advance 提前致谢

Try using styles to set the skins, not states. 尝试使用样式设置外观,而不是状态。

If you want to display those states on the fly, you could dispatch the events form the buttons when you need to. 如果要动态显示这些状态,则可以在需要时通过按钮调度事件。

eg 例如

//do roll over
yourButton.dispatchEvent(new MouseEvent(MouseEvent.ROLL_OVER));
//do roll out
yourButton.dispatchEvent(new MouseEvent(MouseEvent.ROLL_OUT));
//do press
yourButton.dispatchEvent(new MouseEvent(MouseEvent.MOUSE_DOWN));
//do release
yourButton.dispatchEvent(new MouseEvent(MouseEvent.MOUSE_UP));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM