Need a simple Acrobat JavaScript delay

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Don Lancaster

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

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

    #2
    Re: Need a simple Acrobat JavaScript delay

    Don Lancaster wrote:
    [color=blue]
    >
    >
    > 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+ +} ;[/color]

    var timer= setTimeOut("fun ction(){if(glob al.animate){thi s.pageNum++}",5 0);

    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


    [color=blue]
    >
    > It returns a "ReferenceError : setTimeOut is not defined"
    >
    > How do I do a simple (and CPU speed independent) delay as a page action?
    >[/color]

    Comment

    • Stephen Chalmers

      #3
      Re: Need a simple Acrobat JavaScript delay



      Mick White <mwhite13BOGUS@ rochester.rr.co m> wrote in message
      news:raHVd.6009 1$nC5.9983@twis ter.nyroc.rr.co m...[color=blue]
      > Don Lancaster wrote:
      >[color=green]
      > >
      > >
      > > 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+ +} ;[/color]
      >
      > var timer= setTimeOut("fun ction(){if(glob al.animate){thi s.pageNum++}",5 0);
      >
      > Perhaps?[/color]

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

      --
      S.C.


      Comment

      • Mick White

        #4
        Re: Need a simple Acrobat JavaScript delay

        Stephen Chalmers wrote:
        [color=blue]
        > Mick White <mwhite13BOGUS@ rochester.rr.co m> wrote in message
        > news:raHVd.6009 1$nC5.9983@twis ter.nyroc.rr.co m...
        >[color=green]
        >>Don Lancaster wrote:[/color][/color]
        ..[color=blue][color=green][color=darkred]
        >>>
        >>> setTimeOut ("",50) ;
        >>> if (global.animate ){this.pageNum+ +} ;[/color]
        >>
        >>var timer= setTimeOut("fun ction(){if(glob al.animate){thi s.pageNum++}",5 0);
        >>
        >>Perhaps?[/color]
        >
        >
        > The initial error message refers to a case error, as I'm sure you know it's
        > spelled: setTimeout(.... ...)
        >[/color]
        Oops.
        Mick

        Comment

        • Don Lancaster

          #5
          Re: Need a simple Acrobat JavaScript delay

          Mick White wrote:[color=blue]
          > Stephen Chalmers wrote:
          >[color=green]
          >> Mick White <mwhite13BOGUS@ rochester.rr.co m> wrote in message
          >> news:raHVd.6009 1$nC5.9983@twis ter.nyroc.rr.co m...
          >>[color=darkred]
          >>> Don Lancaster wrote:[/color][/color]
          >
          > .
          >[color=green][color=darkred]
          >>>>
          >>>> setTimeOut ("",50) ;
          >>>> if (global.animate ){this.pageNum+ +} ;
          >>>
          >>>
          >>> var timer=
          >>> setTimeOut("fun ction(){if(glob al.animate){thi s.pageNum++}",5 0);
          >>>
          >>> Perhaps?[/color]
          >>
          >>
          >>
          >> The initial error message refers to a case error, as I'm sure you know
          >> it's
          >> spelled: setTimeout(.... ...)
          >>[/color]
          > Oops.
          > Mick[/color]

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

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

          Comment

          • Mick White

            #6
            Re: Need a simple Acrobat JavaScript delay

            Don Lancaster wrote:
            [color=blue]
            > Mick White wrote:
            >[color=green]
            >> Stephen Chalmers wrote:
            >>[/color][/color]
            [snip][color=blue][color=green][color=darkred]
            >>>
            >>> The initial error message refers to a case error, as I'm sure you
            >>> know it's
            >>> spelled: setTimeout(.... ...)
            >>>[/color]
            >> Oops.
            >> Mick[/color]
            >
            >
            > The Adobe Acrobat JavaScript manual clearly says setTimeOut
            >
            > Which is correct?[/color]

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

            Comment

            Working...