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
Highlighted
Contributor
Posts: 13
Registered: ‎01-18-2011
My Device: bold 9000
My Carrier: telkomsel

StageWebView in PopUpManager

Hi all,

I got some problem regarding StageWebView in PopUp manager.

 

for some reason, the browser in stagewebview is created outside the popupmanager i declare,

Can any1 help me?

 

 

<?xml version="1.0" encoding="utf-8"?>
<s:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009" 
			   xmlns:s="library://ns.adobe.com/flex/spark" 
			   xmlns:mx="library://ns.adobe.com/flex/mx" 
			   title="About Us" fontSize="20"
			   close="Close(event)" initialize="StageWebViewExample()">
	
	<fx:Script>
		<![CDATA[
			import mx.events.CloseEvent;
			import mx.managers.PopUpManager;
			
			protected function Close(event:CloseEvent):void
			{
				PopUpManager.removePopUp(this);
			}			
			
			private var webView:StageWebView = new StageWebView();
			
			public function StageWebViewExample() 
			{
				webView.stage = this.stage;
				webView.viewPort = new Rectangle( 400, 400, stage.stageWidth, stage.stageHeight );
				webView.loadURL( "http://www.google.com" );
				
				stage.addEventListener( KeyboardEvent.KEY_DOWN, onKey );
			}

			private function onKey( event:KeyboardEvent ):void
			{
				if( event.keyCode == Keyboard.BACK && webView.isHistoryBackEnabled )
				{
					trace("Back.");
					webView.historyBack();
					event.preventDefault();
				}
				
				if( event.keyCode == Keyboard.SEARCH && webView.isHistoryForwardEnabled )
				{
					trace("Forward.");
					webView.historyForward();
				}
			}
		]]>
	</fx:Script>
	
</s:TitleWindow>

 

abut.JPG

 

tq b4 Smiley Very Happy