Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
calvaryftl
Level 7

Stops responding after returning to previous screen

I am developing a channel, using the roListScreen component. I find that when I go down one level, then use the back arrow to return to the previous screen, the system no longer responds to my button press when I attempt to go back down to the next screen again. I can continue to go up the stack, but not down. This happens on levels 1, 2, and 3. I can go down, and back up, but never down again unless I exit and come back in.

Can anyone offer insight on what I might be doing wrong here?

I am using the same code in each function, so I am wondering if there might be some sort of variable scope conflict happening. However, it is my understanding that the variables within a function are scoped to that function, so I don't see how that could be the problem.

Do I need to use unique names in each function?

They all currently look like this:

    screen = CreateObject("roListScreen")
port = CreateObject("roMessagePort")
screen.SetMessagePort(port)
.
.
.


If anyone can offer some guidance here, I'd appreciate it.

Thank you,

Kenny
0 Kudos
3 REPLIES 3\
RokuChris
Roku Employee
Roku Employee

Re: Stops responding after returning to previous screen

Variables are local to the function they're declared in. You do not need to use unique variable names across multiple functions.

The channel could be crashing. Check the debug console for clues.

It could also be that you're getting stuck in the second screen's event loop somehow, so events raised by the first screen are being caught by the wrong event loop.
0 Kudos
calvaryftl
Level 7

Re: Stops responding after returning to previous screen

It's not showing any debug info when it stops replying, but I think you might be on to something with the event loop. I'll double check that section of code.

Thank you for the reply! Smiley Happy

Kenny
0 Kudos
calvaryftl
Level 7

SOLVED Re: Stops responding after returning to previous scre

Found it!

I left off:

if (msg.isScreenClosed()) then
return -1
else


The wait loop never exited because of that. :?
0 Kudos