Skip to main content
Inspiring
September 25, 2017
Answered

how to get screen to refresh in a background app

  • September 25, 2017
  • 1 reply
  • 478 views

I have an AIR program that is running in the background of the screen while i work on other programs. I can tell the app is running, because the tracing windows in Flash Builder shows tracing output, but the window associated with the program doesn't update unless i click on the window to activate it. I would like to force a refresh every now and then, via timer() call, but i can't seem to find a function to request refresh. I know that in Flex there was some kind of invalidate function, but this is a vanilla Adobe AIR program... i am sure there is some simple way to do this, perhaps someone could help me out, much appreciated.

edward

This topic has been closed for replies.
Correct answer magicmouse

Your answer has the correct hint, the frame rate of the app when in the background was set to 0, and so no refreshing occurred (this is on OSX by the way), and all i had to do was set was set stage.frameRate = 2, and then my window catches up every 500 msec, which is fine.

1 reply

Colin Holgate
Inspiring
September 25, 2017

I think that AIR only gives itself a few frames per second when the app is in the background, so you may not get smooth animation. But you could try the stage.invalidate() function you mentioned:

Stage - Adobe ActionScript® 3 (AS3 ) API Reference

magicmouseAuthorCorrect answer
Inspiring
September 25, 2017

Your answer has the correct hint, the frame rate of the app when in the background was set to 0, and so no refreshing occurred (this is on OSX by the way), and all i had to do was set was set stage.frameRate = 2, and then my window catches up every 500 msec, which is fine.