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

how to store an button color in var

New Here ,
Apr 14, 2013 Apr 14, 2013

hi

i have 2 buttons

one red with instance name redc

the other is yellow with instance yellc

and one mc with instance rect_mc

i want when clicking redc button

the color of redc stored in a variable to use it on the mc

so when u click on the rect_mc the color of the mc changed to red

i tried that code but i guess there is no property called "Color"

var r:Color = new Color () ;

redc.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);

function fl_MouseClickHandler(event:MouseEvent):void

{

r = redc.color ;

}

TOPICS
ActionScript
485
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

LEGEND , Apr 14, 2013 Apr 14, 2013

Look into using the ColorTransform class

var newColorTransform:ColorTransform = rect_mc.transform.colorTransform;

newColorTransform.color = ff0000;

rect_mc.transform.colorTransform = newColorTransform;

Translate
LEGEND ,
Apr 14, 2013 Apr 14, 2013

Look into using the ColorTransform class

var newColorTransform:ColorTransform = rect_mc.transform.colorTransform;

newColorTransform.color = ff0000;

rect_mc.transform.colorTransform = newColorTransform;

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 ,
Apr 14, 2013 Apr 14, 2013
LATEST

perfect thanks xD

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