How to display loading message when invoking a native.newWebView

Good morning to the whole community. I have a ploblem to solve: when I invoke native.newWebView it takes some time before the external web page is shown. I would like to show a message using for example display.newSprite that shows me that the page is loading. Use composer.newScene to recall the scene that will display the web page. How can I solve? Thanks in advance

Good morning to the whole community. I have a ploblem to solve: when I invoke native.newWebView it takes some time before the external web page is shown. I would like to show a message using for example display.newSprite that shows me that the page is loading. Use composer.newScene to recall the scene that will display the web page. How can I solve? Thanks in advance

Hello,

Is it normal that you have written two times the same text?

To resolve your problem it’s simple. Display your loading things and then call for example with a timer (0 ms) invoke what you want.

Hello remiduchalard.

 For the double message I did not realize that I had duplicated. How should I use timer could you give me an example?

Load your webView offscreen and then when it is loaded simply transition it on screen.  Look at the docs for webListener events to make this happen.

If you want to show an animated “loading” that’s fine you simply display it, load webView, once loaded shows webView and kill “loading”.

MyDisplaymessage=display.newImage(...) local function myLoading() load your webview and display it when it's totally load end timer.performWithDelay( 1, myLoading)

@SGS purpose a better solution

@remiduchalard

I will do what SGS propose. But you can make an sprite animation simulating a loading and when the listener finish load the webview, pause an make invisible the loading FX. I have never do it I’m just thinking and trying to help.

Hello,

Is it normal that you have written two times the same text?

To resolve your problem it’s simple. Display your loading things and then call for example with a timer (0 ms) invoke what you want.

Hello remiduchalard.

 For the double message I did not realize that I had duplicated. How should I use timer could you give me an example?

Load your webView offscreen and then when it is loaded simply transition it on screen.  Look at the docs for webListener events to make this happen.

If you want to show an animated “loading” that’s fine you simply display it, load webView, once loaded shows webView and kill “loading”.

MyDisplaymessage=display.newImage(...) local function myLoading() load your webview and display it when it's totally load end timer.performWithDelay( 1, myLoading)

@SGS purpose a better solution

@remiduchalard

I will do what SGS propose. But you can make an sprite animation simulating a loading and when the listener finish load the webview, pause an make invisible the loading FX. I have never do it I’m just thinking and trying to help.