Hi,
I have done speedometer in flash works fine by entering the value. But my client wants to change the color as pointer moves:
0-20: Dark Green (Very Cheap)
20-40: Light Green (Cheap)
40-60: Yellow (Spare Valuation)
60-80: Orange (Expensive)
80-100: Dark Red (Very Expensive)
I know value has to be converted into radians/ degrees.
Below is the link which i have created and as2 is below and you can see source file attached! Please help me!!
http://www.laetuseducation.com/test/
import fl.transitions.;
import fl.transitions.easing.;
import mx.transitions.Tween;
var control_btn:Button;
var my_btn:Button;
user.onSetFocus = function() {
warningTxt.text = “”;
_root.instructions._visible = true;
};
control_btn.onRelease = function() {
if (_root.user.text == “”) {
_root.instructions._visible = false;
_root.warningTxt.text = “Please enter the value”;
}
var userNumber:Number = user.text*1.8;
var RotateT:Tween = new Tween(my_btn, “_rotation”, Strong.easeIn, 0, userNumber, 5, true);
if ((userNumber>=0) && (userNumber<=20)) {
var colorful1 = new Color("_root.my_btn");
colorful1.setRGB(0x009900);
} else if ((userNumber>=21) && (userNumber<=40)) {
var colorful2 = new Color("_root.my_btn");
colorful2.setRGB(0x00FF00);
} else if ((userNumber>=41) && (userNumber<=60)) {
var colorful3 = new Color("_root.my_btn");
colorful3.setRGB(0xFFFF00);
} else if ((userNumber>=61) && (userNumber<=80)) {
var colorful4 = new Color("_root.my_btn");
colorful4.setRGB(0xFFCC00);
} else {
var colorful5 = new Color("_root.my_btn");
colorful5.setRGB(0xFF0000);
}
};