Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

There is possible to active and deactive some buttons ?

New Here ,
Jun 11, 2013 Jun 11, 2013

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

TOPICS
ActionScript
406
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jun 11, 2013 Jun 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;

Translate
Community Expert ,
Jun 11, 2013 Jun 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 11, 2013 Jun 11, 2013

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 11, 2013 Jun 11, 2013
LATEST

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;

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines