ForumsProgramming ForumIE vs firefox/other browsers problem

4 3494
PixelSmash
offline
PixelSmash
566 posts
Nomad

Allright, I have a problem. (For those interested; this is what's causing my problems)

You see, the movie itself is fine. It works, no errors or problems. Except for one small detail. For me at least, when viewing the movie in IE, the creature moves extremely slow. Not slow as in a lot of lag, but the movement speed of the creature itself and it's bubbles seems somehow... halved, or even less.

When testing the movie in Flash, it works fine, and in Firefox it works like a charm as well - perfect movement and speed. In IE however it keeps giving me problems!

The code I use for modifying the movement, alpha and rotation are all based on *=, /=, += or -=... but I can't see how that could cause a problem, since I even tried replacing those with what it should resemble - for example replacing rotation += 0.1 with rotation = rotation + 0.1.

In any case, if someone here has any idea, please let me know. I do know there are some differences between IE and Firefox, (obviously,) but knowing how to work around them or never have them occur in the first place would be a definate bonus! Thanks!

  • 4 Replies
waynaul
offline
waynaul
73 posts
Nomad

I ran into a similar problem with IE and Firefox. For me, the problem was rooted in the delay argument in the Timer object I was using. IE does not seem to like delays of less than 10 or 20 milliseconds.

I decided to stop using a Timer object for Timer events and used an ENTER_FRAME event instead. I also did rough calculations of how long of a time period has elapsed since the last frame and the current frame and I factor that into the amount the sprites move; so if the framerate is bad the sprites will move a little faster. That also seemed to help lessen the animation speed discrepancy between browsers.

-Waynaul

PixelSmash
offline
PixelSmash
566 posts
Nomad

Thanks a lot, waynaul - your post nailed it! I found that the delay for the timer was set to 30/1000 ms instead of 1000/30 fps... when I switched it, the result looked very close to the IE version.

So thanks, now I know what to do!

ps. I heard about that solution you mention. I just wonder if that doesn't negatively influence the amount of calculations and thus CPU load...

jdoggparty
offline
jdoggparty
5,860 posts
Nomad

Did you fix it? Because now it looks fine to me. And I have IE

joeybetz
offline
joeybetz
107 posts
Shepherd

For some reason IE likes to run flash around 60fps regardless of what your framerate is at, so if you're using a timer or running it at a higher framerate than 60 you will see a slowdown. It sucks, I know.

The delta time method works best to offset this. Just be aware that if the framerate drops too much, the delta time will grow and movement will be slightly off. For things like collision this can be a nuisance.

Showing 1-4 of 4