468,468 Members | 2,727 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,468 developers. It's quick & easy.

Need a simple Acrobat JavaScript delay



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: do*@tinaja.com

Please visit my GURU's LAIR web site at http://www.tinaja.com
Jul 23 '05 #1
5 6676
Don Lancaster wrote:


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.pag eNum++}",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

It returns a "ReferenceError: setTimeOut is not defined"

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

Jul 23 '05 #2


Mick White <mw***********@rochester.rr.com> wrote in message
news:ra******************@twister.nyroc.rr.com...
Don Lancaster wrote:


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.pag eNum++}",50);

Perhaps?


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

--
S.C.
Jul 23 '05 #3
Stephen Chalmers wrote:
Mick White <mw***********@rochester.rr.com> wrote in message
news:ra******************@twister.nyroc.rr.com...
Don Lancaster wrote: ..

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


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

Perhaps?

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

Oops.
Mick
Jul 23 '05 #4
Mick White wrote:
Stephen Chalmers wrote:
Mick White <mw***********@rochester.rr.com> wrote in message
news:ra******************@twister.nyroc.rr.com...
Don Lancaster wrote:
.

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

Perhaps?


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?

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: do*@tinaja.com

Please visit my GURU's LAIR web site at http://www.tinaja.com
Jul 23 '05 #5
Don Lancaster wrote:
Mick White wrote:
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
Jul 23 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by denis | last post: by
14 posts views Thread by Rene Grothmann | last post: by
1 post views Thread by Rabel | last post: by
6 posts views Thread by Andrew Poulos | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by kmladenovski | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.