Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
New Contributor
Posts: 3
Registered: ‎02-28-2011
My Device: Not Specified

Close QNXStageWebView

Can someone please tell me how to close a QNXStageWebView? 

Developer
Posts: 1,003
Registered: ‎01-16-2011
My Device: PlayBook (sim)
My Carrier: Rogers

Re: Close QNXStageWebView

I don't know of any built in feature so my first thought would be to add a button (or labelbutton) whose sole function was to close the webview. Perhaps it only appears when the webview does.

- If you like my response/post, or it helped you find an answer you were looking for, please provide a Kudo - white star to the bottom right of this post. -
- Please use the search bar at the top, or check out the PlayBook FAQ's for help getting started -
- Hockey DrillBook -
New Contributor
Posts: 3
Registered: ‎02-28-2011
My Device: Not Specified

Re: Close QNXStageWebView

Providing a button is not the problem. I have a spot in my code where I would like to close the view but I can't work out how to get rid of it. 

 

The problem is that there is no close() function or anything similar in QNXStageWebView.

 

 

Developer
Posts: 1,003
Registered: ‎01-16-2011
My Device: PlayBook (sim)
My Carrier: Rogers

Re: Close QNXStageWebView

[ Edited ]

Try setting the webview to null and disposing it.

webview = null
QnxStageWebView.dispose();

 

Sorry, it's super early and only had a couple hours sleep lol.

 

 

                        
private function closeClick (e:MouseEvent):void
                 {
                  if(webView != null){
		  webView.dispose();
		 }

 Again, if this makes no sense sorry lol. (That also assumes your QNXStageWebView is just called webview.

 

- If you like my response/post, or it helped you find an answer you were looking for, please provide a Kudo - white star to the bottom right of this post. -
- Please use the search bar at the top, or check out the PlayBook FAQ's for help getting started -
- Hockey DrillBook -
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Close QNXStageWebView

I have to assume that "webView" is the attribute in the view for this code.  What every your variable name is for the control would work here as well.

 

Do you have:

 

private var mywebview : QNXStageWebView = null;

 

declared?

 

 

Developer
Posts: 1,003
Registered: ‎01-16-2011
My Device: PlayBook (sim)
My Carrier: Rogers

Re: Close QNXStageWebView

Sorry, yah webView is the name of the attribute. In my case I close the webview when a new link is clicked, and begin the process of loading a new one. So all it's checking for is an active webview, and disposing it before it loads a new one.

Which just gave me an idea for something else using that same order of events...
- If you like my response/post, or it helped you find an answer you were looking for, please provide a Kudo - white star to the bottom right of this post. -
- Please use the search bar at the top, or check out the PlayBook FAQ's for help getting started -
- Hockey DrillBook -
Highlighted
New Contributor
Posts: 3
Registered: ‎02-28-2011
My Device: Not Specified

Re: Close QNXStageWebView

I had tried dispose before but a modal background was being opened up by the Facebook API which I mistakenly took for the WebView. 

 

dispose() does in fact get rid of the WebView.

 

Thanks!