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

Trusted Contributor
Posts: 117
Registered: ‎09-06-2011
My Device: 9900
My Carrier: myself

Strange issue with QNXStageWebView

the following code doesnt display the web content properly when it has been loaded. It will only show the webpage when i a do pinch to zoom action on the playbook screen.


	stageBrowser = new QNXStageWebView("test");
							stageBrowser.enableCookies = false;
							stageBrowser.addEventListener(Event.COMPLETE, onSocketConnected);
														stageBrowser.stage           =   this.stage;
							//stageBrowser.zoomToFitWidthOnLoad = true;
							stageBrowser.viewPort        =   new Rectangle(0,0,1024,600);
							stageBrowser.visible = true;
							stageBrowser.zOrder          =   1;



Any one know why and how I can make the page just display as expected when it has loaded the content from the url?




Posts: 427
Registered: ‎02-22-2012
My Device: BlackBerry Z10, BlackBerry Dev Alpha C, BlackBerry PlayBook
My Carrier: Bell

Re: Strange issue with QNXStageWebView

[ Edited ]



I tested out the code you provided and was not able to replicate your result. I tried loading in blackberry.com to test.


It may be the page that you are loading. Have you tried setting the zoom property? 


If you are able to provide a URL I would be able to test further.


Here is my test app that uses your code that I was testing with:


	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.TimerEvent;
	import flash.geom.Rectangle;
	import flash.utils.Timer;
	import qnx.media.QNXStageWebView;
	import qnx.events.WebViewEvent;
	[SWF(height="600", width="1024", frameRate="30", backgroundColor="#FFFFFF")]
	public class QNXStageWebViewTest extends Sprite
		private var stageBrowser:QNXStageWebView;
		private var loginUrl:String = "http://www.blackberry.com";
		public function QNXStageWebViewTest()
		public function initializeUI():void
			stageBrowser = new QNXStageWebView("test");
			stageBrowser.addEventListener(WebViewEvent.DOCUMENT_LOAD_FINISHED, onLoad);
			stageBrowser.addEventListener(WebViewEvent.DOCUMENT_LOAD_FAILED, onFail);
			stageBrowser.enableCookies = false;
			stageBrowser.stage = this.stage;
			stageBrowser.viewPort = new Rectangle(0,0,1024,600);
			stageBrowser.visible = true;
			stageBrowser.zOrder = 1;
		public function onLoad(e:WebViewEvent):void{
		public function onFail(e:WebViewEvent):void{
			trace("Sorry failed :(");



Follow me on Twitter: @dustinmalik
Keep up to date on BlackBerry development: http://devblog.blackberry.com/