views:

27

answers:

1

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

Would like to do something like this:

<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
}
+1  A: 

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");
alxx
but what should I do to make the button state hover?
czerasz
I used this:var skin:AddButtonSkin = buttonId.skin as AddButtonSkin; skin.setCurrentState("over");
czerasz