Skip to main content
Inspiring
November 26, 2012
Answered

Android - long frame delay causing wierd screen redraw

  • November 26, 2012
  • 2 replies
  • 937 views

I am building a game for android devices using Air 3.5 and Flash Builder 4.6

Some of my game sections have quite a bit of loading to do, so broke them up on a time to only load a little bit at a time, thus allowing enter frames and timers to fire between each chunk... and I put a spinning tumbler on the screen as a wait indicator.

however, some of the chunks still take a bit of time to execute (usually when processing large images and such) and can take several hundered milliseconds to execute.

Now, this is not the problem.

The problem is that on these frames that take longer than 33 milliseconds (fps is set to 30) the spinner on screen seems to "jump" backwards for a partial frame.

It's almost like the when the current enterframe runs, there are 2 screen updates occuring... the first update shows the screen contents as they were before the screen started to redraw, and the second updates the screen to what it should be now.... the result is that for that partial frame update, the spinner seems to "jump back" a couple of frames.

This does not occur on the iOS devices or the pc, only android.

Anyone know what could be causing this and how I could stop it from occuring?

This topic has been closed for replies.
Correct answer DaveGallant

Found out what the problem was.

When I was drawing text as an image, I would convert the stage quality to best, do the drawing and convert it back to low.

Since was old code left over from a while ago. I have since altered this code to use drawWithQuality instead and took out the stage.quality changes and the problem has gone away.

2 replies

Inspiring
November 26, 2012

Maybe download monocle/scout adobe profiling tool to get more insight as to what is happening.

http://www.flashrealtime.com/project-monocle/

DaveGallantAuthorCorrect answer
Inspiring
December 10, 2012

Found out what the problem was.

When I was drawing text as an image, I would convert the stage quality to best, do the drawing and convert it back to low.

Since was old code left over from a while ago. I have since altered this code to use drawWithQuality instead and took out the stage.quality changes and the problem has gone away.