![]() Topic awaiting preservation: objects, "this" and settimeout() |
|
---|---|
Author | Thread |
Bipolar (III) Inmate From: schillmania.com |
![]() Recent posts on this stuff reminded me of something I've been wondering about. |
Maniac (V) Inmate From: Brisbane, Australia |
![]() Lotta these questions going around as of late |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
![]() Nope the "this" in a setTimeout/setInterval doesn't work. There's no great solution for this, really... if it took a function as its argument rather than a string, it could be done somehow probably... but I don't know of an easy way. I rarely use setTimeouts that extensively. |
Paranoid (IV) Inmate From: France |
![]() Scott: I've been puzzled too by the fact that the setTimeout function is only available on the window object. So I throw the following piece of code : code: function evalSetTimeout( evalString, delay )
|
Maniac (V) Mad Scientist From: New California |
![]() I've been using the setTimeout within objects for quite a while now and I had always made the object name a member of the object that needed a setTimeout. Then I just called the timer using that. I have looked for alternatives for this and have not found any. |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
![]() I got a line from bratta a long time ago |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
![]() Clever. With that, you only need to find a separate ID string for each object. |