How do I manually trigger a buttons hover state in Flex?

岁酱吖の 提交于 2019-12-13 06:38:30

问题


I need to trigger the hover state of a Flex button programatically, so that it looks like the user is hovering over it. There is a flex page about "Manually dispatching events":

http://livedocs.adobe.com/flex/3/html/help.html?content=events_07.html

Which would work, but what I'd really like to do is change the style of the button without having to throw an event. How can I do this?

Thanks!


回答1:


Is there any reason this wouldn't work?

button.setStyle('skin', button.getStyle('upSkin'));



回答2:


In Flex 4x it is best to change the skin its self, this will do the trick.

 button.setStyle('skinClass', SkinClass);


来源:https://stackoverflow.com/questions/3364244/how-do-i-manually-trigger-a-buttons-hover-state-in-flex

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!