Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
strattonbrazil
Binge Watcher

scene graph page stack management

If I create a screen object and add a scene to it, how do I have that component pop the screen off the stack without having the screen in scope? I believe I just need to call screen.close(), but I don't have access to screen (from what I can tell) inside my component.


sub Main()
screen = ...
scene = ...
screen.setScene(scene)

... wait for screen-close event
end sub



' in component
...
<script>
function onKeyEvent(key as String, press as Boolean) as Boolean
...
' how can I pop this screen on a certain press?
' how can I tell the screen's port it needs to do something like add another screen on top of the current one?
end function
</script>

At this point the scene component is handling key events, but how can I pop the screen from inside my component? Is there a getScreen function accessible from the function? Do I have to pass the screen in? How does the scene component communicate with outside of its scope to do things like popping the current screen or saying "X" screen needs to be put up over it. I see I can set field observers that the component can listen to, but how does the communication happen the other way? Can I send events to the screen's port?
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.