setTimeout function?

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
Posts: 57
Joined: June 12th, 2004, 6:40 pm

I was looking at the script docs and perhaps have missed it but is this first version missing the setTimeout function?

aka for setting something like:
alarmId = setTimeout("alarmFunc()", minutes*60000);

Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

Imp, what does setTimeout() do?

AE scripting is described as 'based on ECMA standard Javascript'. Clearly it has various
AE specific additions, so I'd also expect it to lack things that were considered irrelevant
or unimportant.

Paul T
Posts: 57
Joined: June 12th, 2004, 6:40 pm

Well given that setTimeout is an ecmascript window method, and given Adobe goes with their own UI controls it does not surprise me that it got missed.

basically with setTimeout , you give it a function, and a time delay in milliseconds. Then when it has counted out that time delay it executes the function supplied.

so for a timed alert for example all you would have to code is:

function timer_alert {
alert ("this is time delayed text");

setTimeout("timer_alert()", 60000);

so for example, if you were making a timed autosave script, you could let a user define the timeout value.

otherwise unless I am mistaken it becomes a study in manipulating the date object to handwrap a function that is the equivelant of the time delay(beuller?! :> )

Post Reply