[LEFT][COLOR=#333333][FONT=arial]I’ve literally spent weeks on this and I just don’t understand…
I’m building a pure AS3 game and I’ve gotten pretty far. Everything is running smooth in Chrome and Firefox (50FPS), but IE 8 & 9 are having major stuttering problems. After a while of testing, I found that it’s rendering at about 5 frames per second even though the core game loop is running faster than this.
I’ve done a ton of research into using Enter_Frame, Render event, timers, TimerEvent.UpdateAfterEvent, etc. I’ve tried lots of variations and nothing seems to get me over the IE issue.
Here’s where I’ve ended…
I’ve set stage.framerate = 30.
I’m using Enter_Frame to update all my objects and call stage.invalidate().
I’m using Render event to call draw() on my objects which draws them out to bitmapData object that is attached to the stage. Think of this bitmapData object as a ‘backbuffer’ or ‘canvas’ for all my actors, background, etc. They are all bitmaps that I draw.
I’m timing all my updates and they take < 1 millisecond.
I’m timing all my draws to the canvas (using bitmapData.draw) and they are taking about 11 milliseconds.
Given these two stats (and a perfect world), I would think I could reach something like 80 fps (1000 / 12). I understand my framerate is set to 30, so I should only really get to a reliable 30 fps.
What’s happening is that my update FPS says it’s running at 30 FPS and my draw FPS says it’s running about 30 FPS, but the screen is actully only redrawing itself about 5 FPS. I can see this as I watch my game clock stutter on.
This stumps me, but here’s where it gets wierder. If I wiggle the mouse, my frame rates go down to 19 FPS (update and draw), but the clock ticks really fast as if it’s updating as expected. I stop wiggling the mouse and it all goes back to the stuttering 5 FPS (but reporting 30 FPS).
From what I’m guessing, something is throttling the actual rendering.
I’ve tried using Timers instead of Enter_Frame. I’ve tried using UpdateAfterEvent. I’ve put the draw code in the Enter_Frame and ignored the Render event. None of it is helping (in IE).
Any help or insight would be hugely appreciated.
(I’ve also upgraded from Flash 10.3 to 11 and no change)
Thanks.
[/FONT][/COLOR][/LEFT]