Copy link to clipboard
Copied
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
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;
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
i have only button nothing more i wanna use code to change this
Copy link to clipboard
Copied
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;
Find more inspiration, events, and resources on the new Adobe Community
Explore Now