strattonbrazil
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2015
07:18 PM
scene graph componet -- passing variables
Is there a way to pass variables to a component at initialization? Or after? If I want some part of the component to be dynamic, is there a way to pass this information in? Can I use init() or do I have to make an aux function? Or something else like a message port?
3 REPLIES 3

TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2015
08:23 PM
Re: scene graph componet -- passing variables
"strattonbrazil" wrote:
Is there a way to pass variables to a component at initialization? Or after? If I want some part of the component to be dynamic, is there a way to pass this information in? Can I use init() or do I have to make an aux function? Or something else like a message port?
You can create a custom interface field and set its value. Make sure you add an onChange function to it, so you can detect when the value is changed.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
strattonbrazil
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2015
07:17 PM
Re: scene graph componet -- passing variables
Thanks, this makes sense. How do I pass information/events back like if I want the component to close the current screen?

TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2015
12:39 PM
Re: scene graph componet -- passing variables
"strattonbrazil" wrote:
Thanks, this makes sense. How do I pass information/events back like if I want the component to close the current screen?
You'd use the same method of adding an interface field. The difference is that you'd set the value from within the component, and listen for changes from the main BrightScript thread (via roSGNodeEvent).
Having said that, Roku engineers don't seem to recommend using multiple scenes/screens, per viewtopic.php?f=34&t=88621#p513504
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)