如何在悬停在另一个元素上时设置悬停状态(upSkin)? 这个例子不适用于spark: https://stackoverflow.com/questions/3364244?tab=oldest#tab-top
想做这样的事情:
<s:Button id="but1"/>
<s:Button label="change" mouseOver="button2_mouseOverHandler(event)"/>
protected function button2_mouseOverHandler(event:MouseEvent):void{
//make but1 look like I'm hovering it
}
答案 0 :(得分:1)
当鼠标在元素A上时,您希望元素B改变样式吗?为A创建事件侦听器(MouseEvent.ROLL_OVER,MouseEvent.ROLL_OUT)。或者是什么?
更新:获取皮肤对象并设置以下四种状态之一:up,over,down,disabled(在skin.states数组中找到):
var skin:ButtonSkin = ButtonSkin(button1.skin);
skin.setCurrentState("over");