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: 
sonofabit
Channel Surfer

Showing a "loading" message for long operations

Forgive me if this is obvious or pointed out in docs but I cannot find any mention of it.

in my app when they select an option, there is a http fetch operation that takes at least a few seconds. I want to display a "loading" message while this happens so they dont' click over and over...

how is this done?

the only thread I found that mentioned this said to use screen.ShowMessage("Retrieving..."), but not sure how to use it. I tried m.screen.ShowMessage("Retrieving...") and received the error:

Interface not a member of BrightScript Component (runtime error &hf3)

which I assume means I'm using it incorrectly. can someone point me to the docs or more info on the correct way to do this?

many thanks
0 Kudos
5 REPLIES 5
EnTerr
Roku Guru

Re: Showing a "loading" message for long operations

You need to create/show screen object first, there is no default/global screen in "m". And ShowMessage() is only avail for roPosterScreen and roGridScreen, i figure after searching for ShowMessage the doc wiki
0 Kudos
sonofabit
Channel Surfer

Re: Showing a "loading" message for long operations

thanks for the reply

so if I understand you correctly I have to create a new screen and overlay it while it's loading then remove it?

I'm already on a screen when I want to do this, can I overlay a screen without killing what the current screen is doing?
0 Kudos
RokuJoel
Binge Watcher

Re: Showing a "loading" message for long operations

So the first thing to do when you see a message like

"Interface not a member of BrightScript Component (runtime error &hf3)"

would be to identify the source of the problem:

print type(m.screen)

Since "ShowMessage" only works (as far as I'm aware) with roPosterScreen and roGridScreen, if m.screen is not either one of those then of course you should get that message.

To show a Loading message over other screen types you would probably want to use roImageCanvas as it is the only type that will allow you to see most other screen types underneath it (if you want that).

- Joel
0 Kudos
sonofabit
Channel Surfer

Re: Showing a "loading" message for long operations

thanks for the tips! I'm still getting used to this dev environment, vastly different from anything else i've used 🙂

I'll give the imagecanvas a shot, thanks again!

EDIT: This worked PERFECTLY, exactly what I wanted, thanks!
0 Kudos
EnTerr
Roku Guru

Re: Showing a "loading" message for long operations

"RokuJoel" wrote:
So the first thing to do when you see a message like "Interface not a member of BrightScript Component (runtime error &hf3)" would be to identify the source of the problem:

"Give a man a fish, and you feed him for a day;
show him how to catch fish, and you feed him for a lifetime" indeed! :idea:
0 Kudos