Disposing of stagewebview
Hi guys
I have a problem when trying to dispose of a stagewebview object. I would like to be able to trigger events for disposing of stagewebview from outside of the function the stagewebview was invoked.
Example:
function playIt(event:MouseEvent){
var nowPlaying = new mcPlaying();
nowPlaying.x = 10;
nowPlaying.y = 416;
nowPlaying.name = "nowPlaying";
stage.addChild(nowPlaying);
var idPath = "idPathVars;
var webView:StageWebView = new StageWebView();
webView.stage = this.stage;
webView.viewPort = new Rectangle(10, 440, 300, 70);
webView.loadURL("http://myURL.com/Free.html?id=" + idPath);
nowPlaying.btnCloseTrack.addEventListener(MouseEvent.CLICK, disposeTrack);
function disposeTrack(event:MouseEvent){
webView.dispose();
stage.removeChild(nowPlaying);
}
}
Currently I am disposing of the stageWebView object from within scope, but what I would like to do is call dispose from outside the parent function.
I have tried invoking the stageWebView from above the function but I could not get that going, any help would be greatly appreciated.
Thank you
