Roku Developer Program

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

Showing a dialog from deep down the component tree.

All of the examples of dialogs are a bit simple.  

When you are deep down the component tree how do you display a dialog?  m.top is not my "scene" component and there for nothing happens when I set m.top.dialog.  

How do I get access to that top level scene node?
0 Kudos
2 Replies
joetesta
Level 10

Re: Showing a dialog from deep down the component tree.

I believe the way to do this is to have a field on the child node that's observed by the parent node.  The parent can then see that field changed and set its own field observed by its own parent to pass it on up to the top, where it would be observed and displayed.
aspiring
0 Kudos
nmaves
Level 7

Re: Showing a dialog from deep down the component tree.

So I found this little bit of code and it worked!

m.top.getScene().dialog = dialog


Though it is only supported in 7.6 and up.  I am not sure how many devices run < 7.5
0 Kudos