Question

What is the opposite of "if(Key.isDown(Key.DOWN))"?

so, I've been working on a flash side scroller game, and I'm trying to figure out how to make it stop the walking graphic when you release the key, as opposed to just having the stationary character walk in place.

Any flash geniuses please help! (I could ask my sis, she goes to college for stuff like this... but I don't want to look like an idiot in front of her)

Answers

through my programming experience, my guess is that there isn't any "keyUp" function. i have confirmed this here: http://livedocs.adobe.com/flash/9.0/main…

i suggest you use "if(!Key.isDown(Key.DOWN))" the exclamation mark means "not", meaning "if the DOWN key is not down..."

also, you could use the onKeyUp event to listen for when the key is released

info: http://livedocs.adobe.com/flash/9.0/main…

#1

Common sense maybe helps in this one:

Key.isDown(Key.DOWN) <---- Key.isDown(...) means if it's pressed, Key.DOWN I bet it's the DOWN ARROW. So to check if DOWN ARROW is released you would: if(Key.isUp(Key.DOWN))

#2

"Key.isDown" is a function that checks if a key is actually physically being pressed down, and "Key.DOWN" refers to the down arrowkey. So a key that is not being pressed would be like "if(Key.isUp(Key.DOWN))"

#3