-
Who needs pants?
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
Last edited by hooligan2001; 12-02-2002 at 07:45 PM.
-
.: Weirded Out :.
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......
-
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...
"I always board fast and do danger things. I 'keep real' so I raps for what I do in life."
-ILL Mitch on his rap song, "Fast and Danger"
-
Who needs pants?
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);
}
-
Who needs pants?
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
-
Senior Member
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 but ill leave it here anyway
ill get back to you, i have a lesson now
-
Who needs pants?
No actually that is really useful for the project i am working on thanks heaps
Last edited by hooligan2001; 12-05-2002 at 09:14 AM.
-
Who needs pants?
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 =)
-
Senior Member
oh good, my pleasure
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|