player sprite flashes when moving in chrome

edited May 2013 in Support
I think is related with Keydown event that tutorial says occures when key is pressed. But is continuously triggered during key is pressed instead of one time. Similar to keyTracker.
In firefox occures the same but image not flashes, background slows. I tried to fix this adding a if condition to not calling setAnimation() continuously but is insufficient.
How can i fix this? Thanks.

Comments

  • I'm sorry but I never encountered the problem you describe here. If you call setAnimation() continuously the effect will be that the animation will always be at the first frame.
    Could you provide a code example that produce this effect and tell me exactly which browser/version/os you're using ?
  • Of course. Here is a link to test game: http://192.162.12.30:81/biobanco_www/perez/games/public_html/index.html

    My browser is google chrome 26 and the code is like tutorial until object model chapter but with other sprites and player motion. Thanks!

  • edited May 2013
    It's very rare. The image flashes a lot in local (run from netbeans IDE). But when executed from server, like the link i sent in previous message works close to perfect. Only flashes sometimes and when change direction only.
    The only thing i changed is wrap the entire switch of keydown event inside an if sentence. So when animation is loaded, not run setAnimation() again. Maybe is a problem of my computer, it's low range laptop...
    Thanks for help me.
  • I noticed a simple error in your code at line 127: you do active:true; and you should do active = true;. It may explain some of you problems.

    Do you mean that when you open your code into chrome 26 from the local file you get more flashes ? Or that when you open it from netbeans in some embedded browsers it flashes more?
  • Yes, thanks! :)
    The second problem is a netbeans problem i think. If i run the code from local file in chrome 26 works well. When open the file from netbeans but also in chrome 26 the problem appears. Still flashes although less without the error.
    There is a chrome plugin that connects chrome to netbeans to debug. Maybe is related. But while runs well without netbeans no problem for me, this issue is solutioned for me :)
    Thanks so much.
Sign In or Register to comment.