Loading ...
Sorry, an error occurred while loading the content.
 

setTimeout issue in Adobe SVG Viewer 3.0

Expand Messages
  • Antoine Quint
    Hey, Has anybody tried to use setTimeout with arguments to be passed to the called function? Here s how it is defined: setTimeout(function, msec[, arg1[, ...,
    Message 1 of 7 , Feb 28, 2002
      Hey,

      Has anybody tried to use setTimeout with arguments to be passed to the
      called function? Here's how it is defined:

      setTimeout(function, msec[, arg1[, ..., argN]])

      I can't seem to get it to work in ASV3, anybody has knowledge about
      this? Should we file a bug report?

      Antoine
    • rkgeorge2000
      Hi Antoine, This is interesting. No I ve only used the setTimeout in the simplest sense: timer = setTimeout( moveButtonCursor() ,250); which does work in
      Message 2 of 7 , Feb 28, 2002
        Hi Antoine,

        This is interesting.

        No I've only used the setTimeout in the simplest sense:
        timer = setTimeout('moveButtonCursor()',250);
        which does work in type="text/javascript" mode. I have not tried this
        in the a3:scriptImplementation="Adobe" type="text/ecmascript" mode,
        but I am not familiar with msec[, arg1[, ..., argN]])
        How are these arguments supposed to work?

        Thanks
        rkgeorge

        by the way great articles on O'Reilly I'm learning a lot each month!

        --- In svg-developers@y..., "Antoine Quint" <antoine@g...> wrote:
        > Hey,
        >
        > Has anybody tried to use setTimeout with arguments to be passed to
        the
        > called function? Here's how it is defined:
        >
        > setTimeout(function, msec[, arg1[, ..., argN]])
        >
        > I can't seem to get it to work in ASV3, anybody has knowledge about
        > this? Should we file a bug report?
        >
        > Antoine
      • Antoine Quint
        Hi, ... msec is the time in miliseconds, 250 in your simple example. arg1 , arg2 , ..., argN are the arguments you want to pass to your function. ...
        Message 3 of 7 , Feb 28, 2002
          Hi,

          > No I've only used the setTimeout in the simplest sense:
          > timer = setTimeout('moveButtonCursor()',250);
          > which does work in type="text/javascript" mode. I have not tried this
          > in the a3:scriptImplementation="Adobe" type="text/ecmascript" mode,
          > but I am not familiar with msec[, arg1[, ..., argN]])
          > How are these arguments supposed to work?

          "msec" is the time in miliseconds, 250 in your simple example.
          "arg1", "arg2", ..., "argN" are the arguments you want to pass to your
          function.

          > by the way great articles on O'Reilly I'm learning a lot each month!

          Wow, thanks! Keep saying that :)

          Antoine
        • rkgeorge2000
          Yes that would be nice. I didn t know there was a way to pass args and used a global var. I ve only used the setTimeout for recursive polling of the server
          Message 4 of 7 , Feb 28, 2002
            Yes that would be nice. I didn't know there was a way to pass args
            and used a global var.
            I've only used the setTimeout for recursive polling of the server
            with getUrl/postUrl which isn't very complicated.
            I'm looking forward to an article on using setTimeout :)

            rkgeorge

            > "msec" is the time in miliseconds, 250 in your simple example.
            > "arg1", "arg2", ..., "argN" are the arguments you want to pass to
            your
            > function.
            >
            > Antoine
          • honnen_martin
            ... the ... Can t you use setTimeout( function () { yourFunction(arg1, ..., argN); }, msec) ??
            Message 5 of 7 , Feb 28, 2002
              --- In svg-developers@y..., "Antoine Quint" <antoine@g...> wrote:
              > Hey,
              >
              > Has anybody tried to use setTimeout with arguments to be passed to
              the
              > called function? Here's how it is defined:
              >
              > setTimeout(function, msec[, arg1[, ..., argN]])

              Can't you use
              setTimeout( function () { yourFunction(arg1, ..., argN); }, msec)
              ??
              >
              > I can't seem to get it to work in ASV3, anybody has knowledge about
              > this? Should we file a bug report?
              >
              > Antoine
            • Antoine Quint
              Hi Honnen, ... As far as I know, if you are using the setTimeout() function with two arguments, the first argument should be a string expression. I would need
              Message 6 of 7 , Mar 1, 2002
                Hi Honnen,

                > Can't you use
                > setTimeout( function () { yourFunction(arg1, ..., argN); }, msec)
                > ??

                As far as I know, if you are using the setTimeout() function with two
                arguments, the first argument should be a string expression. I would
                need to try this out though with the function as an expression.

                However, I believe we should not have to use a workaround here, and if
                it is a bug kindly ask Adobe to fix it.

                Antoine
              • sorotokin
                ... the ... Adobe SVG Viewer implementation is documented here: http://www.protocol7.com/svg-wiki/default.asp?AdobeSVGViewerWindow This particular API is
                Message 7 of 7 , Mar 1, 2002
                  --- In svg-developers@y..., "Antoine Quint" <antoine@g...> wrote:
                  > Hey,
                  >
                  > Has anybody tried to use setTimeout with arguments to be passed to
                  the
                  > called function? Here's how it is defined:
                  >
                  > setTimeout(function, msec[, arg1[, ..., argN]])
                  >
                  > I can't seem to get it to work in ASV3, anybody has knowledge about
                  > this? Should we file a bug report?
                  >
                  > Antoine

                  Adobe SVG Viewer implementation is documented here:

                  http://www.protocol7.com/svg-wiki/default.asp?AdobeSVGViewerWindow

                  This particular API is clearly pre-W3C: it takes arbitrary
                  number of parameters, which is, IMHO, not a good thing to
                  standartize, so I do not think it is worth copying what HTML
                  browsers do.

                  In the long run, I think it would be a good idea to do this
                  through SMIL (but I dont know if SMIL WG has this idea yet,
                  someone wants to check on that?). Something like that:

                  <smil:timeout id="timeout" dur="3s"
                  repeatCount="indefinite" onstart="..."/>

                  or

                  timeout.addEventListener( "begin", eventHandler, false )

                  The same event could then also trigger animations and
                  generally do what W3C events do.

                  Peter
                Your message has been successfully submitted and would be delivered to recipients shortly.