-
button press meter ?
I was wondering if anyone could help me in how to make button meter. What i mean buy this is where you have to press one or two buttons as quick as you can and it makes the meter go up. Like in the athletic running games and when you8 slow down the meter decreases.
Anyone :cool:
-
Attempt
Hey,
Thought i would give it a shot..... no scripts just ideas
You could have it so on the button press an MC _XScale increases. Then, inside the MC of the meter have a countdown timer that makes it go down.
When i get back from college tomorrow i will give it a shot....
Sorry if im talking ****, but its kinda late......:doughnut:
-
Ok, make a button and a bar, on the bar movieclip, line the bottom of it up with the lil + in the middle, name the bars instance name "bar". Then on the button place this action...
on (release) {
_root.bar._yscale++;
}
I hope that helps...
:doughnut:
-
Thnx for that :) didnt use it, though it gave me an idea heres what i did
i put this on the percentage bar :)
Code:
onClipEvent(load) {
keyState = "up";
trace(keyState);
}
onClipEvent(enterFrame) {
if(Key.isDown(Key.SPACE) and (keyState == "up")) {
_height ++;
keyState = "down";
trace(keyState);
}
}
onClipEvent(keyUp) {
keyState = "up"
trace(keyState);
}
-
Ow quick question. I know their is a better way to detect if a specific key is up but i cant get it to work. The way i have it is so if any key is released it sets keyState to up, but that will stuff up what im trying to do. So the real question is how do i dectect if the SPACE key is released :)
-
the easiest way to check if a key is up, is to just check if a certain key isnt down. this can easily be done with...
Code:
if (!Key.isDown(Key.SPACE)) {
//space key is not pressed
}
maybe you could have a boolean that stores what the space key is doing...
Code:
onClipEvent(enterFrame){
if (Key.isDown(Key.SPACE)) {
spaceDwn = true;
}
if (!Key.isDown(Key.SPACE)) {
spaceDwn = false;
}
if (spaceDwn) {
_height++;
}
}
okay... i now realise that this is a silly solution for your problem :cool: but ill leave it here anyway :p
ill get back to you, i have a lesson now :(
-
No actually that is really useful for the project i am working on thanks heaps :)
-
i think i worked out a good way of working my problem :)
just use
getCode();
eg
Code:
onClipEvent(keyUp) {
a = Key.getCode();
trace(a);
}
any other suggestions are welcome =)
-