setTimeout function?

Find out why the . goes before the /

Moderator: Paul Tuersley

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

July 17th, 2004, 12:57 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);


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

August 4th, 2004, 2:35 pm

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
Impudent1
Posts: 57
Joined: June 12th, 2004, 6:40 pm

August 5th, 2004, 11:34 am

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?! :> )

Imp
Post Reply