screen = CreateObject("roSGScreen")
port = CreateObject("roMessagePort")
[size=85][font=Helvetica Neue, Helvetica, Arial, sans-serif] while (true)[/font][/size]
msg = wait(0, port)
msgType = type(msg)
if msgType = "roSGScreenEvent"
[size=85][font=Helvetica Neue, Helvetica, Arial, sans-serif] end if[/font][/size]
<component name = "exitapp" extends = "Task" >
<field id = "Content" type = "node" />
<script type="text/brightscript" uri="pkg:/source/main.brs" />
<script type = "text/brightscript" >
PRINT "IN EXIT TASK"
m.top.functionName = "exitout"
' Terminate the channel, exiting back to the Roku Home screen
' The first Home keypress is needed to exit the screensaver
' The second Home key press will exit to the Home screen
ut = CreateObject("roUrlTransfer")
I may not know what I'm talking about or maybe it's different for video channels or scenegraph, but for my game, I simply RETURN from the Main() function (which is "AS VOID"), and since it's over, the channel exits.
When the use selects "exit game" from the menu, it sets a flag, and a line at end of my main while loop within Main() always checks for that flag, and if it sees it, RETURN.
Maybe my method is unreliable or susceptible to future software changes or something, and I should switch to using "keypress/Home" approach.
So you can't just use "END" in the script section of a callback? Does that leave processes running?