hi there
i got a problem with my rotating meter. it works with key press.
Z= 1/4
X = 1/2
C = 3/4
V = 4/4
R = reset the meter to zero
the problem it tat the meter just go haywire when it goes more than 180 degrees rotation. so i cant get it go to 3/4 and beyond. i dunno where i go wrong. any kind soul to help me. thanks alot.
var rSpeed:Number = 5;
function dMove(obje, rot) {
obje.onEnterFrame = function() {
mover = (rot-this._rotation)/rSpeed;
this._rotation += mover;
largeDisc._rotation = disc._rotation;
};
}
var keyListener = new Object();
keyListener.onKeyDown = function() {
// play meter 1/4
if (Key.getCode() == 90) {
dMove(disc, 65);
}
// play meter 1/2
if (Key.getCode() == 88) {
dMove(disc, 145);
}
// play meter 3/4
if (Key.getCode() == 67) {
dMove(disc, 200);
}
// play meter 4/4 (full)
if (Key.getCode() == 86) {
dMove(disc, 300);
}
//reset key r
if (Key.getCode() == 82) {
dMove(disc, 0);
}
};
Key.addListener(keyListener);
stop();