By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,774 Members | 1,394 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,774 IT Pros & Developers. It's quick & easy.

Need a simple Acrobat JavaScript delay

P: n/a


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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a


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

P: n/a
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

P: n/a
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

P: n/a
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.