Need a simple Acrobat JavaScript delay

D

Don Lancaster

I am conjuring up some simple JavaScript animation routies that work
entirely WITHIN Acrobat .PDF files.

They work very well but they are waay too fast! And are also CPU speed
dependent.

I want to present each page "cell" for, say, 50 milliseconds.

This "too fast" JavaScript set page action code works fine ..

if (global.animate){this.pageNum++} ;

This JavaScript set page action code does not work...

setTimeOut ("",50) ;
if (global.animate){this.pageNum++} ;

It returns a "ReferenceError: setTimeOut is not defined"

How do I do a simple (and CPU speed independent) delay as a page action?

--
Many thanks,

Don Lancaster
Synergetics 3860 West First Street Box 809 Thatcher, AZ 85552
voice: (928)428-4073 email: (e-mail address removed)

Please visit my GURU's LAIR web site at http://www.tinaja.com
 
M

Mick White

Don said:
I am conjuring up some simple JavaScript animation routies that work
entirely WITHIN Acrobat .PDF files.

They work very well but they are waay too fast! And are also CPU speed
dependent.

I want to present each page "cell" for, say, 50 milliseconds.

This "too fast" JavaScript set page action code works fine ..

if (global.animate){this.pageNum++} ;

This JavaScript set page action code does not work...

setTimeOut ("",50) ;
if (global.animate){this.pageNum++} ;

var timer= setTimeOut("function(){if(global.animate){this.pageNum++}",50);

Perhaps?

It's not clear what "this" refers to, since you haven't posted the whole
script, but if "this" refers to the global scope, I would guess that it
could be omitted.
Mick
 
S

Stephen Chalmers

Mick White said:
var timer= setTimeOut("function(){if(global.animate){this.pageNum++}",50);

Perhaps?

The initial error message refers to a case error, as I'm sure you know it's
spelled: setTimeout(.......)
 
D

Don Lancaster

Mick said:
Oops.
Mick

The Adobe Acrobat JavaScript manual clearly says setTimeOut

Which is correct?

More likely possibility is that "" is unacceptable while "function()"
will get accepted.

--
Many thanks,

Don Lancaster
Synergetics 3860 West First Street Box 809 Thatcher, AZ 85552
voice: (928)428-4073 email: (e-mail address removed)

Please visit my GURU's LAIR web site at http://www.tinaja.com
 
M

Mick White

Don said:
Mick said:
Stephen Chalmers wrote:
[snip]
The initial error message refers to a case error, as I'm sure you
know it's
spelled: setTimeout(.......)
Oops.
Mick


The Adobe Acrobat JavaScript manual clearly says setTimeOut

Which is correct?

Then "setTimeOut" appears to be part of the Adobe Acrobat DOM, not core
javascript.
Mick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top