shaharbad
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2023
07:00 AM
How to wait a function finishes and pass variable between files in Roku BrightScript
I'm building a Roku channel and I'm facing a problem where I need a function to finish in order to run the lines afterwards & also I cant figure how to access a variable between components, this is the flow I have:
file1.brs
MainFunction.observeField("itemSelected", "func1") -first wait for this to finish MainFunction.observeField("itemSelected", "func2") -then run this sub func2() print var1 end sub
file2.brs
sub func1() var1 = (get content from some database) end sub
1 REPLY 1
NoobTube
Reel Rookie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2023
11:52 PM
Re: How to wait a function finishes and pass variable between files in Roku BrightScript
How about observing the var1 inside func1() and when it got some value execute func2()?