views:

226

answers:

3

Hi.

I'm trying to create a top panel menu that contains 5 buttons.

I configured Up and Over state for each button.

how can I configure that one the button is clicked, the look of the button will change to the look i configured in Over state.

Each state contains a different image.

Is there a way to change the look of the button to the look it configured in it's different states using Action Script?

Using Flash CS4 Action Script 3.

thank you.

A: 

In the onClick event for the button you can change Up skin to be the same as the Over skin.

Jason W
how can i do that ?
ufk
if your button skins are dynamically assigned it would be the same as the initial assignment. Otherwise you will need to manually change the button attributes like bobthabuilda has shown in the click handler --btn.changeColor('#ff9900');
Jason W
+1  A: 

Something like this should work:

button.addEventListener(MouseEvent.CLICK, onButtonClick);
function onButtonClick(e:MouseEvent):void {
    // Given you have a changeColor method defined in your button class
    e.target.changeColor('#ff9900');
}
bobthabuilda
A: 

I resolved the issue by creating a MovieClip with two frames, one for with each button state, and i just used gotoAndStop when needed to move to the required frame.

In each state I didn't need only to change color, but to the change the all visual presentation of the button.

it seems that i could not find any way to do that with a regular Button Object.

thanks.

ufk