Skip to main content
Known Participant
June 11, 2013
Answered

There is possible to active and deactive some buttons ?

  • June 11, 2013
  • 1 reply
  • 437 views

Hey. I have code to detect what page of my flash book is active and question now: there is possible to make 4 diferent effect for one button depend on what page is active? example:

page 1 : button is red

page 2 : button is blue

page 3 :button is black

i think this is possible but cant figure out how to make this

This topic has been closed for replies.
Correct answer kglad

if you have a simplebutton, you can change its color using its transform.colorTransform property:

var ct:ColorTransform=yourbutton.transform.colorTransform;

if(this.currentFrameLabel=="page 1"){

ct.color=0xff0000;

} else if(this.currentFrameLabel=="page 2"){

ct.color=0x0000ff;

} else if(this.currentFrameLabel=="page 3"){

ct.color=0x000000;

}

yourbutton.transform.colorTransform=ct;

1 reply

kglad
Community Expert
Community Expert
June 11, 2013

do you have a button movieclip with keyframes showing a red,blue and black button?  are you using code to change your button's color?

szeli33Author
Known Participant
June 11, 2013

i have only button nothing more i wanna use code to change this

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
June 11, 2013

if you have a simplebutton, you can change its color using its transform.colorTransform property:

var ct:ColorTransform=yourbutton.transform.colorTransform;

if(this.currentFrameLabel=="page 1"){

ct.color=0xff0000;

} else if(this.currentFrameLabel=="page 2"){

ct.color=0x0000ff;

} else if(this.currentFrameLabel=="page 3"){

ct.color=0x000000;

}

yourbutton.transform.colorTransform=ct;