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

Click object to change colour.

New Here ,
Apr 22, 2014 Apr 22, 2014

Copy link to clipboard

Copied

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

Views

185

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

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