1 Reply Latest reply on Mar 28, 2014 8:35 PM by kyle.burke

    Increasing lag with jQuery's attr?

    kyle.burke

      Hi,

      I'm working on a project in Animate that's much bigger than what I've done in the past, and I'm noticing some weird issues with lag. I have multiple instances where I change an <img> tag's src with jQuery's attr() method, for example: sym.getSymbol("answer-circles").$(answer+"circle").attr("src","images/question-circle-cor rect.png");

      As my project goes on (after roughly 25-30 seconds) there starts to be a noticeable delay in when the method is called, and when the image actually changes. This gap seems to get linearly longer and longer. An old post here suggested that animation lag can be born out of rapidly looping symbols. I tested this by extending the length of my symbols (just copy-pasting their animation out multiple times), and then turning off the symbols altogether when that didn't seem to have an effect. What really confuses me is that there's no framerate hitching to speak of, and the rest of my code seems to execute right when it's called. attr() is the only thing that's getting tripped up. I don't think my code is THAT inefficient, so I can't think of what else might be causing this. Thanks

        • 1. Re: Increasing lag with jQuery's attr?
          kyle.burke Level 1

          Developments:

          I ran my project on a local Apache webserver, instead of testing it through Edge Animate (using cmd-enter). The lag completely dissipated! Not totally sure what's at work here, but I suspect that XAMPP, the server I'm using, is more efficient about grabbing and caching images than what is built into Edge (my understanding of http serving is pre-e-etty sparse, so I'm totally pulling this out of the air). If you encounter similar issues with loading lots of images, I recommend trying out the same, to start.

          1 person found this helpful