Packagecom.distriqt.extension.nativewebview
Classpublic final class NativeWebView
InheritanceNativeWebView Inheritance flash.events.EventDispatcher

This class represents the NativeWebView extension.



Public Properties
 PropertyDefined By
  browserView : BrowserView
[read-only] Access to the web browser view
NativeWebView
  cookieManager : CookieManager
[read-only] Access to get Cookie Manager for managing web view cookies
NativeWebView
  implementation : String
[read-only] The implementation currently in use.
NativeWebView
  isSupported : Boolean
[static] [read-only] Whether the current device supports the extensions functionality
NativeWebView
  nativeVersion : String
[read-only] The native version string of the native extension.
NativeWebView
  service : NativeWebView
[static] [read-only] The singleton instance of the NativeWebView class.
NativeWebView
  version : String
[read-only] The version of this extension.
NativeWebView
Public Methods
 MethodDefined By
  
Constructor You should not call this directly, but instead use the singleton access
NativeWebView
  
Attempts to resolve the availability issue by redirecting the user to the appropriate setting
NativeWebView
  
createWebView(viewPort:Rectangle, options:WebViewOptions = null, stage:Stage = null):WebView
Create a WebView and initialises the viewport and options of the view.
NativeWebView
  
dispose():void
Disposes the extension and releases any allocated resources.
NativeWebView
  
init(key:String):void
Deprecated: You no longer need to use an application key
[static] Initialises the extension class for use with the provided key.
NativeWebView
  
initCache(memoryCapacity:int = 16777216, diskCapacity:int = 33554432):void
Deprecated: Use initialisePlatform options instead
Initialise the size of the web cache.
NativeWebView
  
initialisePlatform(options:NativeWebViewOptions, callback:Function = null):void
Initialises the platform options that apply to all webviews created.
NativeWebView
  
isAvailable():Boolean
Checks if the webview functionality is currently available.
NativeWebView
Public Constants
 ConstantDefined By
  EXT_CONTEXT_ID : String = com.distriqt.NativeWebView
[static]
NativeWebView
  VERSION : String = 8.0.0
[static]
NativeWebView
Property Detail
browserViewproperty
browserView:BrowserView  [read-only]

Access to the web browser view


Implementation
    public function get browserView():BrowserView
cookieManagerproperty 
cookieManager:CookieManager  [read-only]

Access to get Cookie Manager for managing web view cookies


Implementation
    public function get cookieManager():CookieManager
implementationproperty 
implementation:String  [read-only]

The implementation currently in use. This should be one of the following depending on the platform in use and the functionality supported by this extension:


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

Whether the current device supports the extensions functionality


Implementation
    public static function get isSupported():Boolean
nativeVersionproperty 
nativeVersion:String  [read-only]

The native version string of the native extension.


Implementation
    public function get nativeVersion():String
serviceproperty 
service:NativeWebView  [read-only]

The singleton instance of the NativeWebView class.


Implementation
    public static function get service():NativeWebView

Throws
Error — If there was a problem creating or accessing the extension, or if the key is invalid
versionproperty 
version:String  [read-only]

The version of this extension.

This should be of the format, MAJOR.MINOR.BUILD


Implementation
    public function get version():String
Constructor Detail
NativeWebView()Constructor
public function NativeWebView()

Constructor You should not call this directly, but instead use the singleton access

Method Detail
attemptResolveAvailability()method
public function attemptResolveAvailability():Boolean

Attempts to resolve the availability issue by redirecting the user to the appropriate setting

Returns
Booleantrue if a resolution process was started and false otherwise
createWebView()method 
public function createWebView(viewPort:Rectangle, options:WebViewOptions = null, stage:Stage = null):WebView

Create a WebView and initialises the viewport and options of the view.

Parameters

viewPort:Rectangle — The viewport to use as the bounds of the WebView. Must be in screen pixel coordinates.
 
options:WebViewOptions (default = null) — Optional: Defines the options to use when creating the WebView, allows specifying things such as zooming, scrolling and background colour
 
stage:Stage (default = null) — Optional: If specified allows the extension to help manage focus events between inputs in the webview and in AIR.

Returns
WebView

Example
The following creates a web view of size 100x100 and adds the COMPLETE and ERROR event handlers
         var viewPort:Rectangle = new Rectangle( 0, 0, 100, 100 );
                  var options:WebViewOptions = new WebViewOptions();
         options.mediaPlaybackRequiresUserAction = false;
                  var webView:WebView = NativeWebView.service.createWebView( viewPort, options, this.stage );
                  webView.addEventListener( NativeWebViewEvent.COMPLETE, webView_completeHandler );
         webView.addEventListener( NativeWebViewEvent.ERROR, webView_errorHandler );
         
dispose()method 
public function dispose():void

Disposes the extension and releases any allocated resources. Once this function has been called, a call to init is neccesary again before any of the extensions functionality will work.

init()method 
public static function init(key:String):void
Deprecated: You no longer need to use an application key

Initialises the extension class for use with the provided key.

Parameters

key:String

initCache()method 
public function initCache(memoryCapacity:int = 16777216, diskCapacity:int = 33554432):void
Deprecated: Use initialisePlatform options instead

Initialise the size of the web cache. The best usage of this function is to call it once in your application before creating any WebView instances.

iOS Only

Parameters

memoryCapacity:int (default = 16777216) — The size of memory cache in bytes
 
diskCapacity:int (default = 33554432) — The size of the disk cache in bytes

initialisePlatform()method 
public function initialisePlatform(options:NativeWebViewOptions, callback:Function = null):void

Initialises the platform options that apply to all webviews created. You cannot change these settings, unless you dispose the extension (along with all WebViews). Most of these options are platform specific, meaning that they apply settings that are only applicable to specific platforms. If you do not call this function then it will be called automatically with the defaults when the first webview is created.

Parameters

options:NativeWebViewOptions
 
callback:Function (default = null)

isAvailable()method 
public function isAvailable():Boolean

Checks if the webview functionality is currently available. This may return false if the user has disabled the web view functionality.

Returns
Booleantrue if the webview functionality is currently available and false if the user has disabled it
Constant Detail
EXT_CONTEXT_IDConstant
public static const EXT_CONTEXT_ID:String = com.distriqt.NativeWebView

VERSIONConstant 
public static const VERSION:String = 8.0.0