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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Adobe AIR Development

Reply
Regular Contributor
mahesh_DT
Posts: 65
Registered: ‎11-21-2011
My Carrier: developer
Accepted Solution

Browser in application window.

Hello everyone,

I have tried to open a browser page using "Navigate to URL(www.google.com)", But it will open a new web browser page.

But is it possible to open a browser in an application window itself. How does it possible. Please can any one suggest me.

Thank you in advance.

 

Please use plain text.
Developer
zezke
Posts: 815
Registered: ‎12-12-2010
My Carrier: Mobile Vikings

Re: Browser in application window.

Take a look at QNXStageWebView. There are some examples at the bottom of that page.

-------------------------------------------
Your like is much appreciated!
Samples: Park in Ghent
Feeling generous? Nominate me for BB Elite member!
Please use plain text.
Regular Contributor
mahesh_DT
Posts: 65
Registered: ‎11-21-2011
My Carrier: developer

Re: Browser in application window.

Thank you very much,

I  found the answer from the url...i have added the browser page in my application its working fine...

Now a small problem, Again how should i go back from the browser to my application pages, Is it possible.I have tried

in this way..

private function viewChangingHandler(event:LocationChangeEvent):void
{
	//event.preventDefault();			
       var urlstring:String = new String(event.location);
       trace("Hello changing String"+urlstring);					
	var arraydata:Array = urlstring.split("?");			    
			if(event.location == "http://livelongidtrans?"+arraydata[1])
			{
				trace("Webpage died and white page will appear");
				//removeChild(Proposalform.backpage1);
				if(this.numChildren!=0)
				{
					var i1:int = this.numChildren;
					while( i1 -- )
					{
						this.removeChildAt(i1);
					}
				} 
				
					
				
				var backpage2:MenuPage = new MenuPage();
				this.addChild(backpage2);
mySwv.removeEventListener(LocationChangeEvent.LOCATION_CHANGING, viewChangingHandler); } }

 But it is not redirecting to my mainpage of the application. How can i get this.

Your help will be appreciated,

Thank you in advance.

Please use plain text.
Regular Contributor
mahesh_DT
Posts: 65
Registered: ‎11-21-2011
My Carrier: developer

Re: Browser in application window.

Thank god... I have found the answer...We should null the height and width of the rectangle size in the function
Please use plain text.
Regular Contributor
mahesh_DT
Posts: 65
Registered: ‎11-21-2011
My Carrier: developer

Re: Browser in application window.

Hello every one,

Now i have to create a webpage using html in playbook in QNXStagewebview, I had done with the example.For the text type its working fine but how to add images..I have done in this way...

package
{
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.TimerEvent;
	import flash.geom.Rectangle;
	import flash.utils.Timer;
	import qnx.events.WebViewEvent;
	import qnx.media.QNXStageWebView;
	import qnx.ui.events.*;
	import qnx.ui.progress.PercentageBar;
	[SWF(height="600", width="1024", frameRate="30", backgroundColor="#FFFFFF")]
	public class Browapp extends Sprite
	{
		private var mySwv:QNXStageWebView;
		private var myProgress:PercentageBar;
		private var timer:Timer;
		public function Browapp()
		{
			initializeUI();
		}
		public function initializeUI():void
		{
			
			var htmlString:String;
			htmlString = "<!DOCTYPE HTML>" +
				"<html>" +
				"<body>" +
				"<h1>My First Heading</h1>" +
				"<p>My first paragraph.</p>" +
				"<img src="+"assets/alert.png"+"" +
				"width="+206+"" +
				"hspace="+10+""+
				"height="+111+"/>"+
				"</body>" +
				"</html>";			
			trace(htmlString);
			mySwv = new QNXStageWebView("LocalVP");
			mySwv.stage = this.stage;
			mySwv.viewPort = new Rectangle(50,50,400,500); 
			mySwv.loadString(htmlString, "text/html");			
		}
		private function handleTimerTick(e:Event):void 
		{
			myProgress.progress = mySwv.loadProgress/100;
		}
		private function onLoad(e:WebViewEvent):void
		{
			myProgress.progress = 1;
			mySwv.zOrder = 0;
			myProgress.destroy();
		}
		private function onFail(e:WebViewEvent):void
		{
			trace("The document failed to load");
		}
	}
}

 From the above code, Images are not loading, It is giving a null image with questionmark on it....

Please help me to find the sollution for this problem.

Thank you in advance.

Please use plain text.