Packageqnx.media
Classpublic final class QNXStageWebView
InheritanceQNXStageWebView Inheritance flash.events.EventDispatcher

The QNXStageWebView class enables you to display browsable HTML content in a stage view port.

The QNXStageWebView class provides a comprehensive means to display HTML content on QNX devices. For example, the QNXStageWebView class provides, methods to pass values or call functions between ActionScript and JavaScript. You can use the QNXStageWebView class to display and browse content on the Web, or to load and render local content. The QNXStageWebView class uses the system web control provided by the device operating system.

The QNXStageWebView class is NOT a display object and cannot be added to the Flash display list. Instead, to display a QNXStageWebView object, you must attach it directly to the stage using the stage property. A QNXStageWebView instance that is attached to a stage is displayed on top of any Flash display objects or behind the stage. There is no way to control the depth ordering of different QNXStageWebView objects with respect to Flash display objects. However, you may set the zOrder property to order the QNXStageWebView objects with respect to each other or the stage.

You can control the size and position of the rendering area by setting the viewPort property.

When the content within the QNXStageWebView object has focus, the QNXStageWebView object has the first opportunity to handle keyboard input. The stage, to which the QNXStageWebView object is attached, dispatches any keyboard input that is not handled. The normal event capture/bubble cycle does not apply here since the QNXStageWebView instance is not part of the display list.

AIR profile support: This feature is supported only on QNX devices. You can test for support at run time using the QNXStageWebView.isSupported property. See AIR Profile Support for more information regarding API support across multiple profiles.

View the examples

See also

HistoryItem
WebViewEvent
StageWebView
HTMLLoader


Public Properties
 PropertyDefined By
  active : Boolean
Determines if the browser is active or inactive.
QNXStageWebView
  blockPopups : Boolean
Determines whether or not to enable the standard browser popup-blocking engine for generic window.open calls from Javascript.
QNXStageWebView
  certificateInfo : CertificateInfo
[read-only] Retrieves the certificate information for the currently displayed page.
QNXStageWebView
  contentRectangle : Rectangle
[read-only] The rectangle that defines the size of the content of the web page after transformations due to user zoom.
QNXStageWebView
  customHTTPHeaders : Vector.<URLRequestHeader>
Defines custom HTTP headers that are sent in addition to the standard headers.
QNXStageWebView
  defaultFontSize : int
Default font size is applied.
QNXStageWebView
  defaultTextEncoding : String
The default text encoding if the browser cannot auto-detect the encoding of the page.
QNXStageWebView
  displayDefaultDialogs : Boolean
[write-only] Sets a Boolean that determines if default dialogs will be displayed.
QNXStageWebView
  enableCookies : Boolean
Determines whether or not cookies should be saved and sent back to pages.
QNXStageWebView
  enableCrossSiteXHR : Boolean
Determines whether or not to allow cross site XHR (XMLHttpRequest).
QNXStageWebView
  enableGeolocation : Boolean
Determines whether or not geolocation APIs should be enabled.
QNXStageWebView
  enableJavaScript : Boolean
Determines whether or not to execute Javascript.
QNXStageWebView
  enablePlugins : Boolean
Determines whether or not plugins should be enabled.
QNXStageWebView
  enableResourceFiltering : Boolean
Enables the following events on this webview.
QNXStageWebView
  enableWebInspector : Boolean
Determines whether or not web inspector should be enabled.
QNXStageWebView
  enableWebSockets : Boolean
Determines whether or not web sockets should be available to pages.
QNXStageWebView
  encryptionInfo : String
[read-only] Retrieves the encryption info for the currently displayed page.
QNXStageWebView
  favicon : BitmapData
[read-only] Gets the favicon for the current page.
QNXStageWebView
  forcedTextEncoding : String
Forced text encoding is applied.
QNXStageWebView
  historyLength : int
[read-only] The length of the history list.
QNXStageWebView
  historyList : Array
[read-only] Retrieves a copy of the history list.
QNXStageWebView
  historyPosition : int
The position of the currently active page in the history list.
QNXStageWebView
  isHistoryBackEnabled : Boolean
[read-only] Determines whether there is a previous page in the browsing history.
QNXStageWebView
  isHistoryForwardEnabled : Boolean
[read-only] Determines whether there is a next page in the browsing history.
QNXStageWebView
  isSupported : Boolean
[static] [read-only] Determines whether the QNXStageWebView class is supported on the current device.
QNXStageWebView
  javaScriptInterruptTimeout : int
Specifies the timeout period (in seconds) after which a long running piece of JavaScript is interrupted.
QNXStageWebView
  loadImages : Boolean
Determines whether or not to load images when the page is loading.
QNXStageWebView
  loadProgress : int
[read-only] Retrieves the loading progress of the current page.
QNXStageWebView
  location : String
[read-only] The URL of the current location.
QNXStageWebView
  originalLocation : String
[read-only] The URL of the originally entered location before any redirects.
QNXStageWebView
  privateBrowsing : Boolean
The private browsing flag tells the QNXStageWebView object to enable private browsing mode.
QNXStageWebView
  scrollPosition : Point
The current scroll position of the content.
QNXStageWebView
  secureType : String
[read-only] Retrieves the security type for the currently displayed page.
QNXStageWebView
  stage : Stage
The stage on which this QNXStageWebView object is displayed.
QNXStageWebView
  status : String
[read-only] Gets the current status bar content.
QNXStageWebView
  textEncoding : String
[read-only] The current text encoding of the content on the page.
QNXStageWebView
  title : String
[read-only] The HTML title value.
QNXStageWebView
  tooltip : String
[read-only] Gets the current tool-tip.
QNXStageWebView
  userAgent : String
The user-agent that is currently reported by the browser to servers during HTTP requests and to web content in scripts.
QNXStageWebView
  userStyleSheet : String
Specifies a user stylesheet which overrides the stylesheet that is set by the page.
QNXStageWebView
  viewPort : Rectangle
The area on the stage in which the QNXStageWebView object is displayed.
QNXStageWebView
  visible : Boolean
Specifies the visibility property for this QNXStageWebView instance.
QNXStageWebView
  windowUniqueId : String
[read-only] The unique ID of the window.
QNXStageWebView
  zoomToFitWidthOnLoad : Boolean
Determines if the browser will automatically zoom the page to fit the width of the viewport on load.
QNXStageWebView
  zOrder : int
Specifies the z-order of the QNXStageWebView instance with respect to other windows that are children of the stage.
QNXStageWebView
Public Methods
 MethodDefined By
  
QNXStageWebView(name:String)
Creates a QNXStageWebView object.
QNXStageWebView
  
assignFocus(direction:String = none):void
Assigns focus to the content within this QNXStageWebView object.
QNXStageWebView
  
Clears browsing data.
QNXStageWebView
  
clearCache():void
Clears the browser cache.
QNXStageWebView
  
Clears any cookie information.
QNXStageWebView
  
Clears all brower history.
QNXStageWebView
  
Clears any local storage.
QNXStageWebView
  
dispose():void
Disposes of this QNXStageWebView object.
QNXStageWebView
  
downloadCancel(downloadId:uint):void
Used in conjunction with the Downloadevents.
QNXStageWebView
  
downloadPause(downloadId:uint):void
Used in conjunction with the Downloadevents.
QNXStageWebView
  
downloadRemove(downloadId:uint):void
Used in conjunction with the Downloadevents.
QNXStageWebView
  
downloadResume(downloadId:uint):void
Used in conjunction with the Downloadevents.
QNXStageWebView
  
downloadRetry(downloadId:uint):void
Used in conjunction with the Downloadevents.
QNXStageWebView
  
downloadUpdate(downloadId:uint, action:String, filename:String):void
Used in conjunction with the Downloadevents.
QNXStageWebView
  
executeJavaScript(script:String):String
Executes the JavaScript code that is specified by script asynchronously.
QNXStageWebView
  
findString(string:String, forward:Boolean = true):void
Finds and selects the next/last string that is a case-insensitive match in the web page.
QNXStageWebView
  
Navigates to the previous page in the browsing history.
QNXStageWebView
  
Navigates to the next page in the browsing history.
QNXStageWebView
  
loadString(text:String, mimeType:String = text/html):void
Loads and displays the specified HTML string.
QNXStageWebView
  
loadStringWithBase(text:String, baseURL:String, mimeType:String = text/html):void
Loads and displays the specified HTML string with the specified baseURL.
QNXStageWebView
  
loadURL(url:String):void
Loads the page at the specified URL.
QNXStageWebView
  
notifyResourceDataReceived(streamId:int, data:ByteArray):void
Used in conjunction with the NetworkResourceDataRequested event to substitute the network stream with custom data and headers.
QNXStageWebView
  
notifyResourceDone(streamId:int):void
Used in conjunction with the NetworkResourceDataRequested event to substitue the network stream with custom data and headers.
QNXStageWebView
  
notifyResourceHeaderReceived(streamId:int, key:String, value:String):void
Used in conjunction with the NetworkResourceDataRequested event to substitute the network stream with custom data and headers.
QNXStageWebView
  
notifyResourceOpened(streamId:int, status:int, message:String):void
Used in conjunction with the NetworkResourceDataRequested event to substitute the network stream with a custom response code.
QNXStageWebView
  
reload():void
Reloads the current page.
QNXStageWebView
  
removeGeolocationFilter(url:String):void
Remove the filter associated with a url.
QNXStageWebView
  
scrollBy(dx:int, dy:int):void
Scroll the content by the specified amount (in pixels).
QNXStageWebView
  
stop():void
Halts the current load operation.
QNXStageWebView
  
updateGeolocationFilter(url:String, allow:Boolean):void
Set whether a url is allowed access to geolocation information.
QNXStageWebView
Events
 Event Summary Defined By
  The Event.COMPLETE constant defines the value of the type property of a complete event object.QNXStageWebView
   Dispatched when an unknown protocol has been requested that could not be handled by networking.QNXStageWebView
   Dispatched when the QNXStageWebView object is created.QNXStageWebView
   Dispatched when the QNXStageWebView object has been destroyed.QNXStageWebView
   Dispatched when the application receives a response from the server indicating a location change and page load operation.QNXStageWebView
   Dispatched when the javascript document.onload event is fired.QNXStageWebView
   Dispatched when a document load operation fails.QNXStageWebView
   Dispatched when a document load operation has finished.QNXStageWebView
   Signals that the download has started.QNXStageWebView
   Signals that the download has started.QNXStageWebView
   Signals that a download is about to start.QNXStageWebView
   Signals that the download has started.QNXStageWebView
  Indicates that a network error has occurred.QNXStageWebView
  Defines the value of the type property of a focusIn event object.QNXStageWebView
  Defines the value of the type property of a focusOut event object.QNXStageWebView
   Dispatched when the browser (or plugin) has entered full screen mode.QNXStageWebView
   Dispatched when the browser (or plugin) is about to enter full screen mode.QNXStageWebView
   Dispatched when the browser (or plugin) has exited full screen mode.QNXStageWebView
   Signals that the geolocation filter list has been updated.QNXStageWebView
   Dispatched when a call has been made to the qnx.callExtensionMethod function in JavaScript.QNXStageWebView
   Dispatched when a JavaScript exception has occurred.QNXStageWebView
   Dispatched when a long running JavaScript instance has been interrupted.QNXStageWebView
   Dispatched when the result of a executeJavaScript call has been completed.QNXStageWebView
  Indicates that the window location has changed, and returns information about what caused the window to change locations.QNXStageWebView
  Indicates that the window location is changing, and returns information about what caused the window to change locations.QNXStageWebView
   Dispatched when a network resource is requested.QNXStageWebView
   Dispatched when the browser requests that a new QNXStageWebView instance should be opened.QNXStageWebView
   Dispatched when a property of the QNXStageWebView has changed (for any number of reasons).QNXStageWebView
   Dispatched when an unknown protocol has been requested that could not be handled by networking.QNXStageWebView
   Dispatched when an unknown protocol has been requested that could not be handled by the browser.QNXStageWebView
   Signals that the Window object has been cleared and that scripts may now be optinally injected.QNXStageWebView
Public Constants
 ConstantDefined By
  SECURITY_TYPE_FAILED : String = securityTypeFailed
[static] All certificates failed to be validated.
QNXStageWebView
  SECURITY_TYPE_FULL : String = securityTypeFull
[static] All page resources using valid certificates.
QNXStageWebView
  SECURITY_TYPE_NONE : String = securityTypeNone
[static] No page resources using security.
QNXStageWebView
  SECURITY_TYPE_PARTIAL : String = securityTypePartial
[static] Some page resources using valid certificates.
QNXStageWebView
Property Detail
activeproperty
active:Boolean

Determines if the browser is active or inactive.

The default value for this property is true.


Implementation
    public function get active():Boolean
    public function set active(value:Boolean):void
blockPopupsproperty 
blockPopups:Boolean

Determines whether or not to enable the standard browser popup-blocking engine for generic window.open calls from Javascript. When this is enabled, only user requested popups will be allowed.

The default value for this property is true.


Implementation
    public function get blockPopups():Boolean
    public function set blockPopups(value:Boolean):void
certificateInfoproperty 
certificateInfo:CertificateInfo  [read-only]

Retrieves the certificate information for the currently displayed page.


Implementation
    public function get certificateInfo():CertificateInfo
contentRectangleproperty 
contentRectangle:Rectangle  [read-only]

The rectangle that defines the size of the content of the web page after transformations due to user zoom.


Implementation
    public function get contentRectangle():Rectangle
customHTTPHeadersproperty 
customHTTPHeaders:Vector.<URLRequestHeader>

Defines custom HTTP headers that are sent in addition to the standard headers.

The default value of this property is nul.


Implementation
    public function get customHTTPHeaders():Vector.<URLRequestHeader>
    public function set customHTTPHeaders(value:Vector.<URLRequestHeader>):void
defaultFontSizeproperty 
defaultFontSize:int

Default font size is applied.

This is used to override the default font size for the browser. The range is 1 to 120.

The default value is 16.


Implementation
    public function get defaultFontSize():int
    public function set defaultFontSize(value:int):void
defaultTextEncodingproperty 
defaultTextEncoding:String

The default text encoding if the browser cannot auto-detect the encoding of the page.

The default value of this property is utf-8.


Implementation
    public function get defaultTextEncoding():String
    public function set defaultTextEncoding(value:String):void
displayDefaultDialogsproperty 
displayDefaultDialogs:Boolean  [write-only]

Sets a Boolean that determines if default dialogs will be displayed.


Implementation
    public function set displayDefaultDialogs(value:Boolean):void
enableCookiesproperty 
enableCookies:Boolean

Determines whether or not cookies should be saved and sent back to pages.

The default value of this property is true.


Implementation
    public function get enableCookies():Boolean
    public function set enableCookies(value:Boolean):void
enableCrossSiteXHRproperty 
enableCrossSiteXHR:Boolean

Determines whether or not to allow cross site XHR (XMLHttpRequest).

The default value of this property is true.


Implementation
    public function get enableCrossSiteXHR():Boolean
    public function set enableCrossSiteXHR(value:Boolean):void
enableGeolocationproperty 
enableGeolocation:Boolean

Determines whether or not geolocation APIs should be enabled.

The default value of this property is true.


Implementation
    public function get enableGeolocation():Boolean
    public function set enableGeolocation(value:Boolean):void
enableJavaScriptproperty 
enableJavaScript:Boolean

Determines whether or not to execute Javascript.

The default value of this property is true.


Implementation
    public function get enableJavaScript():Boolean
    public function set enableJavaScript(value:Boolean):void
enablePluginsproperty 
enablePlugins:Boolean

Determines whether or not plugins should be enabled.

The default value of this property is true.


Implementation
    public function get enablePlugins():Boolean
    public function set enablePlugins(value:Boolean):void
enableResourceFilteringproperty 
enableResourceFiltering:Boolean

Enables the following events on this webview.

The default value of this property is false.


Implementation
    public function get enableResourceFiltering():Boolean
    public function set enableResourceFiltering(value:Boolean):void
enableWebInspectorproperty 
enableWebInspector:Boolean

Determines whether or not web inspector should be enabled.

The default value of this property is false.


Implementation
    public function get enableWebInspector():Boolean
    public function set enableWebInspector(value:Boolean):void
enableWebSocketsproperty 
enableWebSockets:Boolean

Determines whether or not web sockets should be available to pages.

The default value of this property is true.


Implementation
    public function get enableWebSockets():Boolean
    public function set enableWebSockets(value:Boolean):void
encryptionInfoproperty 
encryptionInfo:String  [read-only]

Retrieves the encryption info for the currently displayed page.


Implementation
    public function get encryptionInfo():String
faviconproperty 
favicon:BitmapData  [read-only]

Gets the favicon for the current page.


Implementation
    public function get favicon():BitmapData
forcedTextEncodingproperty 
forcedTextEncoding:String

Forced text encoding is applied.

This is used to override a possibly incorrect decision by the browser about the encoding of a page. Set this value to nul to cancel forcedTextEncoding.

The default value is Nul.


Implementation
    public function get forcedTextEncoding():String
    public function set forcedTextEncoding(value:String):void
historyLengthproperty 
historyLength:int  [read-only]

The length of the history list.


Implementation
    public function get historyLength():int
historyListproperty 
historyList:Array  [read-only]

Retrieves a copy of the history list. The history list is an Array of qnx.media.HistoryItem objects. Note that the 0th item is the earliest visited location.


Implementation
    public function get historyList():Array
historyPositionproperty 
historyPosition:int

The position of the currently active page in the history list. Note that 0 is the back of the list.


Implementation
    public function get historyPosition():int
    public function set historyPosition(value:int):void
isHistoryBackEnabledproperty 
isHistoryBackEnabled:Boolean  [read-only]

Determines whether there is a previous page in the browsing history.


Implementation
    public function get isHistoryBackEnabled():Boolean
isHistoryForwardEnabledproperty 
isHistoryForwardEnabled:Boolean  [read-only]

Determines whether there is a next page in the browsing history.


Implementation
    public function get isHistoryForwardEnabled():Boolean
isSupportedproperty 
isSupported:Boolean  [read-only]

Determines whether the QNXStageWebView class is supported on the current device.


Implementation
    public static function get isSupported():Boolean
javaScriptInterruptTimeoutproperty 
javaScriptInterruptTimeout:int

Specifies the timeout period (in seconds) after which a long running piece of JavaScript is interrupted. When JavaScript is interrupted, a WebViewEvent.JAVASCRIPT_INTERRUPTED event is fired.

The default value for this property is 0 (milliseconds).


Implementation
    public function get javaScriptInterruptTimeout():int
    public function set javaScriptInterruptTimeout(value:int):void
loadImagesproperty 
loadImages:Boolean

Determines whether or not to load images when the page is loading. If this value is set to false and you decide to to load images, then you must set this flag to true and then reload the page.

The default value for this property is true.


Implementation
    public function get loadImages():Boolean
    public function set loadImages(value:Boolean):void
loadProgressproperty 
loadProgress:int  [read-only]

Retrieves the loading progress of the current page. If the page is fully loaded, this value will remain at 100.


Implementation
    public function get loadProgress():int
locationproperty 
location:String  [read-only]

The URL of the current location.


Implementation
    public function get location():String
originalLocationproperty 
originalLocation:String  [read-only]

The URL of the originally entered location before any redirects.


Implementation
    public function get originalLocation():String
privateBrowsingproperty 
privateBrowsing:Boolean

The private browsing flag tells the QNXStageWebView object to enable private browsing mode. Existing cookies are not used and no browsing information is saved.

The default value of this property is false.


Implementation
    public function get privateBrowsing():Boolean
    public function set privateBrowsing(value:Boolean):void
scrollPositionproperty 
scrollPosition:Point

The current scroll position of the content. If you set a value that extends past the edge of the content, the value will be clamped to the proper value.


Implementation
    public function get scrollPosition():Point
    public function set scrollPosition(value:Point):void
secureTypeproperty 
secureType:String  [read-only]

Retrieves the security type for the currently displayed page.


Implementation
    public function get secureType():String
stageproperty 
stage:Stage

The stage on which this QNXStageWebView object is displayed.

Set stage to nul to hide this QNXStageWebView object, or change the visible property to false.

         mySwv = new QNXStageWebView("myBrowser");
         mySwv.stage = this.stage;
         


Implementation
    public function get stage():Stage
    public function set stage(value:Stage):void
statusproperty 
status:String  [read-only]

Gets the current status bar content.


Implementation
    public function get status():String
textEncodingproperty 
textEncoding:String  [read-only]

The current text encoding of the content on the page.

If you have not set a forced text encoding, this value will be either the auto-detected text encoding, or the default text encoding. Otherwise, it is the forced text encoding.


Implementation
    public function get textEncoding():String
titleproperty 
title:String  [read-only]

The HTML title value.


Implementation
    public function get title():String
tooltipproperty 
tooltip:String  [read-only]

Gets the current tool-tip.


Implementation
    public function get tooltip():String
userAgentproperty 
userAgent:String

The user-agent that is currently reported by the browser to servers during HTTP requests and to web content in scripts.

The default value is system-dependant.


Implementation
    public function get userAgent():String
    public function set userAgent(value:String):void
userStyleSheetproperty 
userStyleSheet:String

Specifies a user stylesheet which overrides the stylesheet that is set by the page. To specify the stylesheet inline, use a data:// URL. Set the url argument to nul to clear the user stylesheet.


Implementation
    public function get userStyleSheet():String
    public function set userStyleSheet(value:String):void
viewPortproperty 
viewPort:Rectangle

The area on the stage in which the QNXStageWebView object is displayed.

         mySwv = new QNXStageWebView("myBrowser"); 
         mySwv.viewPort = new Rectangle(50,50,400,400);
         


Implementation
    public function get viewPort():Rectangle
    public function set viewPort(value:Rectangle):void
visibleproperty 
visible:Boolean

Specifies the visibility property for this QNXStageWebView instance.

The default value for this property is false.


Implementation
    public function get visible():Boolean
    public function set visible(value:Boolean):void
windowUniqueIdproperty 
windowUniqueId:String  [read-only]

The unique ID of the window.

This value can be used with the qnx.display.IowWindow class to retrieve the underlying window. While you can set any property on the window, you should not resize the viewport as this will cause the QNXStageWebView insatnce to fail. This value is constant through the life of a QNXStageWebView but will be regenerated every time you create a new one.


Implementation
    public function get windowUniqueId():String
zoomToFitWidthOnLoadproperty 
zoomToFitWidthOnLoad:Boolean

Determines if the browser will automatically zoom the page to fit the width of the viewport on load.

The default value for this property is true.


Implementation
    public function get zoomToFitWidthOnLoad():Boolean
    public function set zoomToFitWidthOnLoad(value:Boolean):void
zOrderproperty 
zOrder:int

Specifies the z-order of the QNXStageWebView instance with respect to other windows that are children of the stage.

The stage always has a z-order of 0 with respect to children. Windows are painted by the window manager from lowest z-order (backmost) to highest z-order (frontmost). Thus, specifying a value less than 0 will move the QNXStageWebView instance behind the stage (and can be seen through the stage if the stage is not opaque where the QNXStageWebView instance is being displayed). Specifying a value greater than or equal to 0 will move the QNXStageWebView in front of the stage. You must manage the z-order of QNXStageWebView objects if you have more than one, or need to use a special case such as moving behind the stage.

The default value for this property is 0.

In the following listing, the zOrder property of a QNXStageWebView instance is set to -1 (hidden behind the stage) while the class is loading an external URL. When the external content is loaded, the onLoad function is called and the zOrder property is set to 0, which causes the QNXStageWebView to appear in front of the stage and visible to the user.

         mySwv = new QNXStageWebView("myBrowser");
         mySwv.stage = this.stage;
         mySwv.viewPort = new Rectangle(50,50,400,400);
         mySwv.addEventListener(WebViewEvent.DOCUMENT_LOAD_FINISHED, onLoad);
         mySwv.addEventListener(WebViewEvent.DOCUMENT_LOAD_FAILED, onFail);
         mySwv.loadURL("http://www.qnx.com/");
         mySwv.zOrder = -1;
         
         private function onLoad(e:WebViewEvent):void
         {
             mySwv.zOrder = 0;
         }
         


Implementation
    public function get zOrder():int
    public function set zOrder(value:int):void
Constructor Detail
QNXStageWebView()Constructor
public function QNXStageWebView(name:String)

Creates a QNXStageWebView object.

The object is invisible until it is attached to a stage and until the viewPort is set.

Parameters
name:String
Method Detail
assignFocus()method
public function assignFocus(direction:String = none):void

Assigns focus to the content within this QNXStageWebView object.

Direction values are defined in FocusDirection class and include:

Parameters

direction:String (default = none) — A String that specifies whether the first or last focusable object in the displayed content list should receive focus.

clearBrowsingData()method 
public function clearBrowsingData():void

Clears browsing data.

The following types of data are cleared:

clearCache()method 
public function clearCache():void

Clears the browser cache.

clearCookies()method 
public function clearCookies():void

Clears any cookie information.

clearHistory()method 
public function clearHistory():void

Clears all brower history.

clearLocalStorage()method 
public function clearLocalStorage():void

Clears any local storage.

dispose()method 
public function dispose():void

Disposes of this QNXStageWebView object.

Calling dispose() is optional. If you do not maintain a reference to this QNXStageWebView instance it will be eligible for garbage collection. Calling dispose() can make garbage collection occur sooner, or at a more convenient time.

downloadCancel()method 
public function downloadCancel(downloadId:uint):void

Used in conjunction with the Downloadevents. Call this function to cancel a download in the download manager. The download will remain in the download manager until removed.

Parameters

downloadId:uint — The download specified in the event.

downloadPause()method 
public function downloadPause(downloadId:uint):void

Used in conjunction with the Downloadevents. Call this function to pause a download in the download manager.

Parameters

downloadId:uint — The download specified in the event.

downloadRemove()method 
public function downloadRemove(downloadId:uint):void

Used in conjunction with the Downloadevents. Call this function to remove a download from the download manager. If the download is still in progress it will be cancelled.

Parameters

downloadId:uint — The download specified in the event.

downloadResume()method 
public function downloadResume(downloadId:uint):void

Used in conjunction with the Downloadevents. Call this function to resume a paused download in the download manager.

Parameters

downloadId:uint — The download specified in the event.

downloadRetry()method 
public function downloadRetry(downloadId:uint):void

Used in conjunction with the Downloadevents. Call this function to retry a download in the download manager. If the download is already running it will not be affected.

Parameters

downloadId:uint — The download specified in the event.

downloadUpdate()method 
public function downloadUpdate(downloadId:uint, action:String, filename:String):void

Used in conjunction with the Downloadevents. Call this function to set the download action to take for a pending download.

Parameters

downloadId:uint — The download specified in the event.
 
action:String — The action to take from WebDownloadRequestEvent::ACTION_
 
filename:String — The name to save the file as if the aciton is save. Must not be null or empty.

executeJavaScript()method 
public function executeJavaScript(script:String):String

Executes the JavaScript code that is specified by script asynchronously.

This function will immediately return a unique identifier for this executeJavaScript() call and JavaScript code block/line. After the code has completed execution (successfully or otherwise) a JavaScriptResultEvent.JAVASCRIPT_RESULT event is fired containing the unique ID of the executeJavaScript() call and the result that was returned (which may be an empty string).

Parameters

script:String — Specifies the block of JavaScript that will be executed.

Returns
String
findString()method 
public function findString(string:String, forward:Boolean = true):void

Finds and selects the next/last string that is a case-insensitive match in the web page. It will wrap the web page if it reaches the end. An empty String will result in no match and no selection.

This event will fire a FindStringEvent event after the search iss complete.

Parameters

string:String — The String specifying the text to find.
 
forward:Boolean (default = true)true if searching forward, or false if backwards.

See also

historyBack()method 
public function historyBack():void

Navigates to the previous page in the browsing history.

historyForward()method 
public function historyForward():void

Navigates to the next page in the browsing history.

loadString()method 
public function loadString(text:String, mimeType:String = text/html):void

Loads and displays the specified HTML string.

When the loadString() method is used, the location is reported as "about:blank." Only standard URI schemes can be used in URLs within the HTML string. The AIR URI schemes, "app:" and "app-storage:" are not allowed.

The HTML content cannot load local resources, such as image files. XMLHttpRequests are not allowed.

Only the "text/html" and "application/xhtml+xml" MIME types are supported.

Parameters

text:String — The string of HTML or XHTML content to display.
 
mimeType:String (default = text/html) — The MIME type of the content, either "text/html" or "application/xhtml+xml".

loadStringWithBase()method 
public function loadStringWithBase(text:String, baseURL:String, mimeType:String = text/html):void

Loads and displays the specified HTML string with the specified baseURL.

Parameters

text:String — The String of HTML or XHTML content to display.
 
baseURL:String — The String of the URL that this content is reported to come from.
 
mimeType:String (default = text/html) — The MIME type of the content.

loadURL()method 
public function loadURL(url:String):void

Loads the page at the specified URL.

The URL can use the following URI schemes:

Content loaded with the file: scheme can load other local resources.

The following listing loads an external URL.

         mySwv = new QNXStageWebView("myBrowser");
         mySwv.stage = this.stage;
         mySwv.viewPort = new Rectangle(50,50,400,400);
         mySwv.addEventListener(WebViewEvent.DOCUMENT_LOAD_FINISHED, onLoad);
         mySwv.addEventListener(WebViewEvent.DOCUMENT_LOAD_FAILED, onFail);           
         mySwv.loadURL("http://www.qnx.com/");
         

Parameters

url:String — The URL of the content to display.

notifyResourceDataReceived()method 
public function notifyResourceDataReceived(streamId:int, data:ByteArray):void

Used in conjunction with the NetworkResourceDataRequested event to substitute the network stream with custom data and headers. Send all data before notifyResourceDone, but after notifyResourceOpened and notifyResourceHeaderReceived. This function simulates data being received from the server.

Parameters

streamId:int — The stream specified in the event.
 
data:ByteArray — The raw stream of bytes to be loaded by the browser.

notifyResourceDone()method 
public function notifyResourceDone(streamId:int):void

Used in conjunction with the NetworkResourceDataRequested event to substitue the network stream with custom data and headers. Should only be called last, after notifyResourceOpened notifyResourceHeaderReceived and notifyResourceDataReceived. After this function is called the streamId is no longer valid and should be discarded. This function simulates data being received from the server.

Parameters

streamId:int — The stream specified in the event.

notifyResourceHeaderReceived()method 
public function notifyResourceHeaderReceived(streamId:int, key:String, value:String):void

Used in conjunction with the NetworkResourceDataRequested event to substitute the network stream with custom data and headers. Send all headers before notifyResourceDataReceived and notifyResourceDone, but after notifyResourceOpened. This function simulates the result response from the server.

Parameters

streamId:int — The stream specified in the event.
 
key:String — The name of the header property.
 
value:String — The value of the header property.

notifyResourceOpened()method 
public function notifyResourceOpened(streamId:int, status:int, message:String):void

Used in conjunction with the NetworkResourceDataRequested event to substitute the network stream with a custom response code. Call this function first when substituting. This function simulates the result response from the server.

Parameters

streamId:int — The stream specified in the event.
 
status:int — The HTTP status code to return to the browser.
 
message:String — The message to return to the browser.

reload()method 
public function reload():void

Reloads the current page.

removeGeolocationFilter()method 
public function removeGeolocationFilter(url:String):void

Remove the filter associated with a url. This will cause the user to be prompted if the site requests geolocation information.

Parameters

url:String

scrollBy()method 
public function scrollBy(dx:int, dy:int):void

Scroll the content by the specified amount (in pixels).

You may pass negative amounts here. If the amount passed exceeds the edge of the content, the scroll will stop at the edge of the content automatically. This function does not animate the scroll, scroll is moved to the new position as soon as possible.

Parameters

dx:int — The distance to scroll horizontally.
 
dy:int — The distance to scroll vertically.

stop()method 
public function stop():void

Halts the current load operation.

updateGeolocationFilter()method 
public function updateGeolocationFilter(url:String, allow:Boolean):void

Set whether a url is allowed access to geolocation information. If a filter is not set for a site the user is prompted.

Parameters

url:String
 
allow:Boolean

Event Detail
complete Event
Event Object Type: flash.events.Event

The Event.COMPLETE constant defines the value of the type property of a complete event object.

contentRendered Event  
Event Object Type: qnx.events.ContentRenderedEvent
ContentRenderedEvent.type property = qnx.events.ContentRenderedEvent.CONTENT_RENDERED

Dispatched when an unknown protocol has been requested that could not be handled by networking. The url property of the event indicates the target URL.
created Event  
Event Object Type: qnx.events.WebViewEvent
WebViewEvent.type property = qnx.events.WebViewEvent.CREATED

Dispatched when the QNXStageWebView object is created.
destroyed Event  
Event Object Type: qnx.events.WebViewEvent
WebViewEvent.type property = qnx.events.WebViewEvent.DESTROYED

Dispatched when the QNXStageWebView object has been destroyed.
documentLoadCommitted Event  
Event Object Type: qnx.events.WebViewEvent
WebViewEvent.type property = qnx.events.WebViewEvent.DOCUMENT_LOAD_COMMITTED

Dispatched when the application receives a response from the server indicating a location change and page load operation. After this event is fired, you must call back to get back to the old page. Calling stop will interrupt the loading of this page, and will leave the page in its state at the time of the stop call.
documentLoaded Event  
Event Object Type: qnx.events.WebViewEvent
WebViewEvent.type property = qnx.events.WebViewEvent.DOCUMENT_LOADED

Dispatched when the javascript document.onload event is fired. This event will be fired after a given timeout period expires, even if the qnx.events.WebViewEvent.DOCUMENT_LOAD_FINISHED event is never fired.
documentLoadFailed Event  
Event Object Type: qnx.events.WebViewEvent
WebViewEvent.type property = qnx.events.WebViewEvent.DOCUMENT_LOAD_FAILED

Dispatched when a document load operation fails.
documentLoadFinished Event  
Event Object Type: qnx.events.WebViewEvent
WebViewEvent.type property = qnx.events.WebViewEvent.DOCUMENT_LOAD_FINISHED

Dispatched when a document load operation has finished. This event may never be sent as it is possible for a page to never complete loading.
downloadFinished Event  
Event Object Type: qnx.events.WebDownloadFinishedEvent
WebDownloadFinishedEvent.type property = qnx.events.WebDownloadFinishedEvent.DOWNLOAD_FINISHED

Signals that the download has started.
downloadProgress Event  
Event Object Type: qnx.events.WebDownloadProgressEvent
WebDownloadProgressEvent.type property = qnx.events.WebDownloadProgressEvent.DOWNLOAD_PROGRESS

Signals that the download has started.
downloadRequest Event  
Event Object Type: qnx.events.WebDownloadRequestEvent
WebDownloadRequestEvent.type property = qnx.events.WebDownloadRequestEvent.DOWNLOAD_REQUEST

Signals that a download is about to start. You must set the action that you wish to take in response to this event. The default action is to discard the download.
downloadStarted Event  
Event Object Type: qnx.events.WebDownloadStartedEvent
WebDownloadStartedEvent.type property = qnx.events.WebDownloadStartedEvent.DOWNLOAD_STARTED

Signals that the download has started.
error Event  
Event Object Type: qnx.events.NetworkErrorEvent
NetworkErrorEvent.type property = qnx.events.NetworkErrorEvent.ERROR

Indicates that a network error has occurred.

focusIn Event  
Event Object Type: flash.events.FocusEvent

Defines the value of the type property of a focusIn event object.

See also

focusOut Event  
Event Object Type: flash.events.FocusEvent

Defines the value of the type property of a focusOut event object.

See also

fullScreenEnter Event  
Event Object Type: qnx.events.WebViewEvent
WebViewEvent.type property = qnx.events.WebViewEvent.FULL_SCREEN_ENTER

Dispatched when the browser (or plugin) has entered full screen mode. You may stop any animations or processes that the user does not need to unload the CPU while the application is in fullscreen mode.
fullScreenEntering Event  
Event Object Type: qnx.events.WebViewEvent
WebViewEvent.type property = qnx.events.WebViewEvent.FULL_SCREEN_ENTERING

Dispatched when the browser (or plugin) is about to enter full screen mode. Cancel this event to prevent it from entering fullscreen.
fullScreenExit Event  
Event Object Type: qnx.events.WebViewEvent
WebViewEvent.type property = qnx.events.WebViewEvent.FULL_SCREEN_EXIT

Dispatched when the browser (or plugin) has exited full screen mode.
geolocationFilterUpdated Event  
Event Object Type: qnx.events.WebFilterUpdatedEvent
WebFilterUpdatedEvent.type property = qnx.events.WebFilterUpdatedEvent.GEOLOCATION_FILTER_UPDATED

Signals that the geolocation filter list has been updated.
javaScriptCallback Event  
Event Object Type: qnx.events.JavaScriptCallbackEvent
JavaScriptCallbackEvent.type property = qnx.events.JavaScriptCallbackEvent.JAVA_SCRIPT_CALLBACK

Dispatched when a call has been made to the qnx.callExtensionMethod function in JavaScript. The QNXStageWebView object will automatically return the contents of the result member (default null) unless you cancel this event. In that case you must call sendJavaScriptCallbackReturnValue with the result, the browser will wait and no further javaScriptCallback events will be received until sendJavaScriptCallbackReturnValue is called.

The following listing shows a javascript function (in a web page) that calls the qnx.callExtensionMethod() function:

         <script type="text/javascript"> 
             function close(){ 
                     qnx.callExtensionMethod("name","val1","val2");
                     //must have a parameter or else the event is not thrown, no includes are needed 
             } 
         </script> 
        
         

Below, a callback function (in an actionscript class) is set up to capture the name and result of the javascript function.

         webview.addEventListener(JavaScriptCallbackEvent.JAVA_SCRIPT_CALLBACK,function(event:JavaScriptCallbackEvent):void{ 
                 trace("callback complete"); 
                 trace("js name: " + event.name);//first parameter that was given 
                 trace("js result: " + event.result);//null for the moment 
                 for each(var object:String in event.params){
                     //rest of the parameters 
                    trace(object); 
                 }
         }
         
         
javaScriptException Event  
Event Object Type: qnx.events.JavaScriptExceptionEvent
JavaScriptExceptionEvent.type property = qnx.events.JavaScriptExceptionEvent.JAVA_SCRIPT_EXCEPTION

Dispatched when a JavaScript exception has occurred. The event contains the exception String, line number, and file where the exception occurred. This event cannot be cancelled.
javaScriptInterrupted Event  
Event Object Type: qnx.events.WebViewEvent
WebViewEvent.type property = qnx.events.WebViewEvent.JAVA_SCRIPT_INTERRUPTED

Dispatched when a long running JavaScript instance has been interrupted. To increase the timeout, set the javaScriptInterruptTimeout property.
javaScriptResult Event  
Event Object Type: qnx.events.JavaScriptResultEvent
JavaScriptResultEvent.type property = qnx.events.JavaScriptResultEvent.JAVA_SCRIPT_RESULT

Dispatched when the result of a executeJavaScript call has been completed. The uniqueId property of the event contains the uniqueId string that was returned from the executeJavaScript call.
locationChange Event  
Event Object Type: qnx.events.ExtendedLocationChangeEvent
ExtendedLocationChangeEvent.type property = qnx.events.ExtendedLocationChangeEvent

Indicates that the window location has changed, and returns information about what caused the window to change locations.

locationChanging Event  
Event Object Type: qnx.events.ExtendedLocationChangeEvent
ExtendedLocationChangeEvent.type property = qnx.events.ExtendedLocationChangeEvent

Indicates that the window location is changing, and returns information about what caused the window to change locations.

networkResourceRequested Event  
Event Object Type: qnx.events.NetworkResourceRequestedEvent
NetworkResourceRequestedEvent.type property = qnx.events.NetworkResourceRequestedEvent.NETWORK_RESOURCE_REQUESTED

Dispatched when a network resource is requested. The URL of the resource is contained in the url property of the event.

Specify the action you wish to take for this resource:

openWindow Event  
Event Object Type: qnx.events.OpenWindowEvent
OpenWindowEvent.type property = qnx.events.OpenWindowEvent.OPEN_WINDOW

Dispatched when the browser requests that a new QNXStageWebView instance should be opened. The URL property specifies the URL for the QNXStageWebView instance. The name property indicates the name of the window. If a window with the specified name already exists, the window will be reused, otherwise a new window will be created.
propertyChanged Event  
Event Object Type: qnx.events.PropertyChangedEvent
PropertyChangedEvent.type property = qnx.events.PropertyChangedEvent.PROPERTY_CHANGED

Dispatched when a property of the QNXStageWebView has changed (for any number of reasons). The name of the property is stored in the name property of the event.
unknownProtocol Event  
Event Object Type: qnx.events.UnknownProtocolEvent
UnknownProtocolEvent.type property = qnx.events.UnknownProtocolEvent.UNKNOWN_PROTOCOL

Dispatched when an unknown protocol has been requested that could not be handled by networking. The url property of the event indicates the target URL. The streamId property indicates the stream.

Cancelling this event allows the stream to be filtered using the notifyResourcefunctions. Otherwise, the resource load operation will fail.

unsupportedMimeType Event  
Event Object Type: qnx.events.UnsupportedMimeTypeEvent
UnsupportedMimeTypeEvent.type property = qnx.events.UnsupportedMimeTypeEvent.UNSUPPORTED_MIME_TYPE

Dispatched when an unknown protocol has been requested that could not be handled by the browser.
WindowObjectCleared Event  
Event Object Type: qnx.events.WindowObjectClearedEvent
WindowObjectClearedEvent.type property = qnx.events.WindowObjectClearedEvent.WINDOW_OBJECT_CLEARED

Signals that the Window object has been cleared and that scripts may now be optinally injected. Set the scripts property to the javascript that should be injected and optionally executed.
Constant Detail
SECURITY_TYPE_FAILEDConstant
public static const SECURITY_TYPE_FAILED:String = securityTypeFailed

All certificates failed to be validated.

SECURITY_TYPE_FULLConstant 
public static const SECURITY_TYPE_FULL:String = securityTypeFull

All page resources using valid certificates.

SECURITY_TYPE_NONEConstant 
public static const SECURITY_TYPE_NONE:String = securityTypeNone

No page resources using security.

SECURITY_TYPE_PARTIALConstant 
public static const SECURITY_TYPE_PARTIAL:String = securityTypePartial

Some page resources using valid certificates. Some resources have invalid or no secure connection.

Examples
The following code sample attaches a simple QNXStageWebView instance to the stage. It uses a percentage bar control to alert the user that a page is currently being loaded.
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 MyStageWeb extends Sprite
    {
        private var mySwv:QNXStageWebView;
        private var myProgress:PercentageBar;
        private var timer:Timer;
        public function MyStageWeb()
        {
            initializeUI();
        }
        public function initializeUI():void
        {
            timer = new Timer(500);
            timer.addEventListener(TimerEvent.TIMER,handleTimerTick);
            timer.start();
            mySwv = new QNXStageWebView("myBrowser");
            mySwv.stage = this.stage;
            mySwv.viewPort = new Rectangle(50,50,400,400);
            mySwv.addEventListener(WebViewEvent.DOCUMENT_LOAD_FINISHED, onLoad);
            mySwv.addEventListener(WebViewEvent.DOCUMENT_LOAD_FAILED, onFail);
            mySwv.loadURL("http://www.qnx.com/");
            mySwv.scrollBy(100,100);
            mySwv.zoomToFitWidthOnLoad = true;
            mySwv.blockPopups = true;
            mySwv.zOrder = -1;
            myProgress = new PercentageBar();
            myProgress.x = (400-myProgress.width) /2;
            myProgress.y = (500-myProgress.height) /2;
            myProgress.width = 200; 
            this.addChild(myProgress);
        }
        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");
        }
    }
}
     
In the following example, a QNXStageWebView class is attached to the stage to render a String containing HTML markup.
     package
{
    import flash.display.Sprite;
    import flash.geom.Rectangle;
    import qnx.media.QNXStageWebView;
    [SWF(height="600", width="1024", frameRate="30", backgroundColor="#FFFFFF")]
    public class myStageWebLocal extends Sprite
    {
        private var MySwv:QNXStageWebView;
        public function myStageWebLocal()
        {
            initializeUI();
        }
        public function initializeUI():void
        {
            var htmlString:String;
            htmlString = "<!DOCTYPE HTML>" +
                "<html>" +
                "<body>" +
                "<h1>Hello World</h1>" +
                "<p>Hello World</p>" +
                "</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");
        }
    }
}