I'm trying to make some image move every 5 seconds to the left when i press the left arrow key and I want it to stop moving when I press the other arrow keys.
I finished everything exept making the image stop on keydown.
I used setInterval to make the image move.
this is the code with setInterval in it.
var lefttime = setInterval ("moveleft()", 500)
I think im supposed to use document. onKeyDown(clearInterval (lefttime)) but it doesn't work.
could sumone explain how to do this?
and spaces between codes is because this site won't take long words so ignore those.
2006-06-08
13:13:12
·
1 answers
·
asked by
Anonymous
in
Computers & Internet
➔ Programming & Design