Skip to main content
oliversen
Inspiring
May 26, 2018
Question

remove stageWebView issue

  • May 26, 2018
  • 1 reply
  • 502 views

I have this code inside a function:

var webView:StageWebView = new StageWebView();

webView.stage = this.stage;

webView.viewPort = new Rectangle(0,btnTilbake.height,stage.stageWidth,stage.stageHeight);

webView.loadURL(bgmList12[int(button.name.slice(4, button.name.length))]);

//it loads a webpage just as it is supposed to.

I have a button, if I click it I want to remove or hide the webView, the buttons triggers this code:

else if (tilbake == 1) {     //This is my removewebView/hide

trace("JAAAAAA DEN ER 1");

/* I have tried this code:

webView.stage = null; 

webView.dispose(); 

/* I have tried this code:

webView.viewPort = null;

webView.stage = null;

webView.dispose();

/* I have tried this code:

var htmlString:String = "<!DOCTYPE HTML><html><body style=background:#000000><p></p></body></html>";

webView.loadString(htmlString);

webView.reload();

webView.viewPort = null;

webView.dispose();

webView = null;

/* I have tried this code:

webView.viewPoer=(2000,2000,2000,2000); //to just get it away from my screen.

}

It traces this sentence as a test:

JAAAAAA DEN ER 1

Anyone got a clue of why it does not work? As I have done this the excact same way before Thanks

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
May 27, 2018

use

webView.dispose()