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

Click object to change colour.

New Here ,
Apr 22, 2014 Apr 22, 2014

Hi, I was just wondering does anyone know what code I would need to add to change the colour of myRedCircle when myBlueSquare is clicked?

The code I have already is below.

import flash.events.MouseEvent;

var myBlueSquare = new BlueSquare();

var myRedCircle = new RedCircle();

myBlueSquare.x= 50;

myBlueSquare.y=350;

myRedCircle.x=300;

myRedCircle.y=350;

myBlueSquare.addEventListener(MouseEvent.MOUSE_DOWN, doClick);

function doClick(e:MouseEvent):void

{

 

}

TOPICS
ActionScript
198
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
LEGEND ,
Apr 22, 2014 Apr 22, 2014

How is your RedCircle is designed?  Does it have different frames showing different colors, or do you intend to just transform its color from one to another using code?  If it's the latter, look into the ColorTransform class.  If it's the former, explain more about the RedCircle.

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 22, 2014 Apr 22, 2014
LATEST

I just intend to transform it's colour from one to another. Ok I will, thank you!

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