Skip to main content
gamedev.net
🔒 Locked

looping javascript functions

Started by flounder May 18, 2006 at 3:42 PM 1 replies 550+ views
Original Post
flounder
flounder
(i'm not sure what forum this should go in) i'm trying to make a mouse follower using &#106avascript. I have a box that follows the mouse just fine, but it only calls the function to move the box when the mouse moves. I need to know how to call that function continuously. Anyone know?
Kylotan
Kylotan
You will need to use one of the 2 timeout functions to call it every so often. setTimeout is one of the 2 functions, but I can't remember the other. Remember you're sharing the processing time with the browser, so you can't truly do anything continuously in a browser's &#106avascript functions.
LessBread
LessBread
Iirc, the other function is SetInterval.
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.