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
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.assignFocus();
							//stageBrowser.zoomToFitWidthOnLoad = true;
							stageBrowser.viewPort        =   new Rectangle(0,0,1024,600);
							stageBrowser.visible = true;
							//this.addChild(rect);
							stageBrowser.zOrder          =   1;
							stageBrowser.loadURL(loginUrl);

 

 

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

 

 

 

Retired
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 ]

Hi,

 

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:

 

package
{
	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()
		{
			initializeUI();
		}
		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;
			stageBrowser.loadURL(loginUrl);
		}
		
		public function onLoad(e:WebViewEvent):void{
			trace("Connected!");
		}
		
		public function onFail(e:WebViewEvent):void{
			trace("Sorry failed :(");
		}
	}
}

 Regards,

Dustin

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