header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
bumples15
Points:50
Posts:0

8/1/2011 3:51:24 PM

Title: colouring book problem


I am still having trouble with a colouring book program. I did what I was told and got only one color so I put in two more variables for two more colours and got duplicate variables. tried everything and can't seem to get other colours. what am I doing wrong now. isn't the variable different because the color changes?
here is the code.

import flash.events.MouseEvent;

red_btn.addEventListener(MouseEvent.CLICK, changeColour);
blue_btn.addEventListener(MouseEvent.CLICK, changeColour);
green_btn.addEventListener(MouseEvent.CLICK, changeColour);

function changeColour(evt:MouseEvent) : void{
if (evt.target.name=="red_btn"){
arrow_mc.y=103;

}
if (evt.target.name=="blue_btn"){
arrow_mc.y=150;

}
if (evt.target.name=="green_btn"){
arrow_mc.y=103;

}

sky_mc.addEventListener(MouseEvent.CLICK, changeColour2 );
ground_mc.addEventListener(MouseEvent.CLICK, changeColour2 );
bigrabbit_mc.addEventListener(MouseEvent.CLICK, changeColour2 );

var red:ColorTransform = new ColorTransform(0,0,0,0,255,0,0,255);
var blue:ColorTransform = new ColorTransform(0,0,0,0,0,0,255,255);
var green:ColorTransform = new ColorTransform(0,0,0,0,0,255,0,255);

var changeToColour:ColorTransform = new ColorTransform();
changeToColour=red;

var changeToColour:ColorTransform = new ColorTransform();
changeToColour=blue;

var changeToColour:ColorTransform = new ColorTransform();
changeToColour=red;

function changeColour2(evt:MouseEvent) {
evt.target.transform.colorTransform=changeToColour;
}
}
thank you.
Jen




Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 0+2 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions