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

setInterval() problems in Netscape

Expand Messages
  • kevinlindsey@mindspring.com
    I think that I ve been staring at the screen for too long. I am currently controlling my SVG animations via setInterval(). Since animation speed is of prime
    Message 1 of 3 , Jun 28, 2000
    View Source
    • 0 Attachment
      I think that I've been staring at the screen for too long. I am
      currently controlling my SVG animations via setInterval(). Since
      animation speed is of prime importance, I decided to write some
      timing tests. I created a simple SVG document
      (http://www.mindspring.com/~kevinlindsey/Game/Tests/max_400x300.svg)
      to test the actual time between calls of my setInterval() function.
      I stripped down some existing code that I've written and I find that
      setInterval() is not working in Netscape. This is really strange
      because the code that I used as a basis of the test does work in
      Netscape. I've tried numerous things and I cannot determine what the
      problem is.

      Interestingly, I decided to view some of Adobes demo SVG's with
      Netscape. I knew that Lissajou was using setTimeout() which is close
      enough to what I'm doing. It didn't work on my Mac or NT station! I
      did see on Adobe's site that you cannot use alert() within handlers.
      Boy, that makes it challenging to debug these problems. I'm at a
      loss. Any ideas? Again, everything works fine in IE5.0 and I'm
      running under WinNT

      Thanks for any help,
      Kevin
    • Alek Traunic
      I m on NT workstation using NN4.72 & IE5 your demo file works in both... the weird thing is that in IE the time is always less than 30 where in NN it s always
      Message 2 of 3 , Jun 30, 2000
      View Source
      • 0 Attachment
        I'm on NT workstation using NN4.72 & IE5 your demo file works in
        both... the weird thing is that in IE the time is always less than
        30
        where in NN it's always greater than 50 sometime over 100.

        I am looking at a similar situation in my development where I am
        attempting to do a scrolling menu. I have spent most of the day
        researching the most effective solution for doing that in SVG ;)

        -wade

        --- In svg-developers@egroups.com, kevinlindsey@m... wrote:
        > I think that I've been staring at the screen for too long. I am
        > currently controlling my SVG animations via setInterval(). Since
        > animation speed is of prime importance, I decided to write some
        > timing tests. I created a simple SVG document
        > (http://www.mindspring.com/~kevinlindsey/Game/Te
        sts/max_400x300.svg)
        > to test the actual time between calls of my setInterval() function.

        > I stripped down some existing code that I've written and I find
        that
        > setInterval() is not working in Netscape. This is really strange
        > because the code that I used as a basis of the test does work in
        > Netscape. I've tried numerous things and I cannot determine what
        the
        > problem is.
        >
        > Interestingly, I decided to view some of Adobes demo SVG's with
        > Netscape. I knew that Lissajou was using setTimeout() which is
        close
        > enough to what I'm doing. It didn't work on my Mac or NT station!
        I
        > did see on Adobe's site that you cannot use alert() within
        handlers.
        > Boy, that makes it challenging to debug these problems. I'm at a
        > loss. Any ideas? Again, everything works fine in IE5.0 and I'm
        > running under WinNT
        >
        > Thanks for any help,
        > Kevin
      • Kevin Lindsey
        ... I ended up finding out what the problem was. I guess I didn t post my own answer properly. I posted it through the web interface at eGroups, but now I
        Message 3 of 3 , Jun 30, 2000
        View Source
        • 0 Attachment
          Alek wrote:
          > I'm on NT workstation using NN4.72 & IE5 your demo file works in
          > both... the weird thing is that in IE the time is always less than
          > 30
          > where in NN it's always greater than 50 sometime over 100.

          I ended up finding out what the problem was. I guess I didn't post my own
          answer properly. I posted it through the web interface at eGroups, but now
          I notice that I didn't get an email from the posting. I wonder if I should
          have received an email.

          The pages have been corrected, that's why they're working in Netscape now.
          It turned out that IE allows me to use the wrong case when calling
          getElementById().

          FYI, I have found that setInterval() is problematic with IE. When using
          setInterval() in IE, if you refresh your page, IE crashes. I've switched
          over to setTimeout() and the problem has gone away.

          >the weird thing is that in IE the time is always less than 30
          >where in NN it's always greater than 50 sometime over 100.

          I have other tests on that page too, but I get completely the opposite
          results. I'm on NT using NN4.7 and IE5.0. I've found that the larger the
          bounding box which encloses the area of the screen which will need to be
          redrawn, the slower the frame rate is in IE. Higher numbers are worse in my
          tests. However, in NN, the time doesn't fluctuate with my tests. I think
          that if I animated a large object, the times between IE and NN would be
          closer. I have that on my list of tests to try later today.

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