Using the movement keys

I’m new to actionscript, and i have no idea how to script when a key is up.

Example:

if (Key.isDown(Key.UP)) {
shipspeedy = -shipspeed;
}

\How do I script when the key is up??? or just not pressed anymore\