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: 
evan
Visitor

programmatic display and dismissal of a dialog while busy

I see from the documentation that roOneLineDialog has a ShowBusyAnimation method(). I effectively want to throw up a "Please wait..." (with busy animation) dialog while I am fetching things from my web API and parsing them. When finished parsing, I want to programmatically dismiss the dialog. I am having trouble getting this to work in code, and I do not see any programmatic method to make the dialog disappear. How can this be implemented in code? Could you please provide an example?
0 Kudos
1 REPLY 1
RokuSamir
Visitor

Re: programmatic display and dismissal of a dialog while bus

Evan,

The dialog will stay on screen as along as the script holds a reference to the dialog object. So to dismiss the dialog set your reference to the dialog to invalid (or exit the scope of your automatic variable by returning from the function). For example:

dialog = CreateObject("roOneLineDialog")

dialog.setTitle("Please wait...")
dialog.showBusyAnimation()
dialog.show()

'fetch web API data here

'this will dismiss the dialog
dialog = invalid
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.