开发者

change state when hover on another spark element

开发者 https://www.devze.com 2023-01-14 17:39 出处:网络
How to set a hover state (upSkin) when hover on another element? This example is not working on spark:

How to set a hover state (upSkin) when hover on another element? This example is not working on spark: https://stackoverflow.com/questions/3364244?tab=oldest#tab-top

Would like to do something like this:

<s:Button id="but1"/>
<s:Button label="chan开发者_开发问答ge" mouseOver="button2_mouseOverHandler(event)"/>

protected function button2_mouseOverHandler(event:MouseEvent):void{
//make but1 look like I'm hovering it
}


When mouse is over element A, you want element B to change style? Create event listeners for A (MouseEvent.ROLL_OVER, MouseEvent.ROLL_OUT). Or what?

Update: get skin object and set one of the four states: up, over, down, disabled (found in skin.states array):

var skin:ButtonSkin = ButtonSkin(button1.skin);
skin.setCurrentState("over");
0

精彩评论

暂无评论...
验证码 换一张
取 消