02-01-2012 06:32 AM
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.
Solved! Go to Solution.
02-01-2012 07:31 AM
Take a look at QNXStageWebView. There are some examples at the bottom of that page.
02-13-2012 12:09 AM
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.
02-13-2012 01:49 AM
02-13-2012 01:57 AM
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.