Your Digital Media Has Never Looked So Good

Topic Author
Posts: 708
Joined: Wed Feb 10, 2010 4:21 pm

Flashing on a progress screen

Mon Mar 01, 2010 10:08 am

I'm sure people have had the problem of flashing screens, I just wanted to post a possible work around.
This keeps the current screen active till AFTER the new one gets displayed.
--- Start the screen -----
port = CreateObject("roMessagePort")
dp = CreateObject( "roArray", 2, 1 )
dp.Push( CreateObject( "roMessageDialog" ))
dp[0].SetTitle( "Please Wait - Loading" )
dp[0].SetText( "What ever" )
dp[0].AddButton(0, "Cancel")
--- Update the screen -----
dp.Push( CreateObject( "roMessageDialog" ))
dp[1].SetTitle( "Please Wait - Still Loading" )
dp[1].SetText( str )
dp[1].AddButton(0, "Cancel")
dp.Delete( 0 )
User avatar
Roku Engineering
Posts: 796
Joined: Tue Sep 22, 2009 2:29 pm

Re: Flashing on a progress screen

Tue Mar 02, 2010 6:07 pm

It's important that you always have a blank background screen to show under all your screens so that you don't "flash" back to the home screen momentarily. Channels that forget this may run into home screen flashes when they add a linking screen or search screen that becomes the base of their screen stack. It's also useful as a precursor to slow loading screens, and can be used anywhere in your code that you need a default background. This blank background screen is well documented as the "screenFacade" pattern in the developer guide and sample applications, but here's a refresher:

'display a fake screen while the real one initializes. this screen
'has to live for the duration of the whole app to prevent flashing
'back to the roku home screen. By default roPosterScreen displays
'the message 'retrieving...'
'----- Screen Facade Background here ---------------
screenFacade = CreateObject("roPosterScreen")

'---- Slow loading Screen Here ----
' your normal code

'exit the app gently so that the screen doesn't flash to black


Who is online

Users browsing this forum: No registered users and 1 guest