Packagecom.myflashlab.air.extensions.richWebView.android
Classpublic class WebView
InheritanceWebView Inheritance flash.events.EventDispatcher



Public Properties
 PropertyDefined By
  backForwardList : Array
[read-only]
WebView
  chromeClient : ChromeClient
[read-only] Gets the chrome handler.
WebView
  contentHeight : int
[read-only] Gets the height of the HTML content.
WebView
  favicon : BitmapData
[read-only] Gets the favicon for the current page.
WebView
  height : int
Indicates the height of the webview instance
WebView
  initialScale : int
[write-only] Sets the initial scale for this WebView.
WebView
  isPrivateBrowsingEnabled : Boolean
[read-only] Gets whether private browsing is enabled in this WebView.
WebView
  originalUrl : String
[read-only] Gets the original URL for the current page.
WebView
  overScrollMode : int
[write-only] Set the over-scroll mode for this view.
WebView
  rendererPriorityWaivedWhenNotVisible : Boolean
[read-only] Return whether this WebView requests a priority of RENDERER_PRIORITY_WAIVED when not visible.
WebView
  rendererRequestedPriority : int
[read-only] Get the requested renderer priority for this WebView.
WebView
  scrollBarStyle : int
[write-only] Specify the style of the scrollbars.
WebView
  scrollX : int
[read-only]
WebView
  scrollY : int
[read-only]
WebView
  settings : WebSettings
[read-only]
WebView
  width : int
Indicates the width of the webview instance
WebView
  x : int
Indicates the x position of the webview instance relative to the main stage
WebView
  y : int
Indicates the y position of the webview instance relative to the main stage
WebView
Public Methods
 MethodDefined By
  
WebView($ctx:ExtensionContext, $x:int, $y:int, $w:int, $h:int)
WebView
  
addEventListener($type:String, $listener:Function, $useCapture:Boolean = false, $priority:int = 0, $useWeakReference:Boolean = false):void
[override]
WebView
  
Injects the built-in JS code into the loaded HTML page which makes AIR/HTML communication possible.
WebView
  
addView():void
Adds the webview instance to the stage (Native windows will always be placed at the top of AIR content).
WebView
  
callJS($msg:String):void
use this method to call Javascript functions.
WebView
  
canGoBack():Boolean
A Boolean value indicating whether there is a back item in the back-forward list that can be navigated to.
WebView
  
canGoBackOrForward($steps:int):Boolean
WebView
  
canGoForward():Boolean
A Boolean value indicating whether there is a forward item in the back-forward list that can be navigated to.
WebView
  
clearCache($includeDiskFiles:Boolean):void
Clears the resource cache.
WebView
  
Removes the autocomplete popup from the currently focused form field, if present.
WebView
  
Tells this WebView to clear its internal back/forward list.
WebView
  
Clears the SSL preferences table stored in response to proceeding with SSL certificate errors.
WebView
  
close():void
closes and removes the webview instance from stage.
WebView
  
createPrintDocumentAdapter($documentName:String):void
Creates a PrintDocumentAdapter that provides the content of this WebView for printing.
WebView
  
destroy():void
Use close method instead.
WebView
  
evaluateJavascript($msg:String):void
Asynchronously evaluates JavaScript in the context of the currently displayed page.
WebView
  
flingScroll($vx:int, $vy:int):void
WebView
  
getProgress():Number
Gets the progress for the current page.
WebView
  
getTitle():String
Gets the title for the current page.
WebView
  
getUrl():String
Gets the URL for the current page.
WebView
  
goBack():void
Goes back in the history of this WebView.
WebView
  
goForward():void
Goes forward in the history of this WebView.
WebView
  
hide():void
makes the webview instance invisible if it is already visible.
WebView
  
Invokes the graphical zoom picker widget for this WebView.
WebView
  
Loads HTML string as a web content.
WebView
  
loadFile($file:File):void
Navigates to the requested file on the filesystem.
WebView
  
loadUrl($url:String):void
Loads a webpage from a URL.
WebView
  
onPause():void
Does a best-effort attempt to pause any processing that can be paused safely, such as animations and geolocation.
WebView
  
onResume():void
Resumes a WebView after a previous call to onPause().
WebView
  
pageDown($bottom:Boolean):void
Scrolls the contents of this WebView down by half the page size.
WebView
  
pageUp($top:Boolean):void
Scrolls the contents of this WebView up by half the view size.
WebView
  
Pauses all layout, parsing, and JavaScript timers for all WebViews.
WebView
  
postUrl($url:String, $postData:String):void
Loads the URL with postData using "POST" method into this WebView.
WebView
  
reload():void
Reloads the current URL.
WebView
  
removeEventListener($type:String, $listener:Function, $useCapture:Boolean = false):void
[override]
WebView
  
requestFocus($direction:int):Boolean
Call this to try to give focus to a specific view or to one of its descendants and give it hints about the direction and a specific rectangle that the focus is coming from.
WebView
  
Resumes all layout, parsing, and JavaScript timers for all WebViews.
WebView
  
saveWebArchive($basename:String, $autoname:Boolean):void
Saves the current view as a web archive.
WebView
  
scrollBy(x:int, y:int):void
WebView
  
scrollTo(x:int, y:int):void
WebView
  
setBackgroundColor($color:String):void
Sets the background color for this view.
WebView
  
setNetworkAvailable($networkUp:Boolean):void
Informs WebView of the network state.
WebView
  
setRendererPriorityPolicy($rendererRequestedPriority:int, $waivedWhenNotVisible:Boolean):void
Set the renderer priority policy for this WebView.
WebView
  
setViewPort($rect:Rectangle):void
set the x,y,width,height of this webview instance.
WebView
  
show():void
makes the webview instance visible if it is already invisible.
WebView
  
stopLoad():void
Stops the current load.
WebView
  
WebView
  
switchBitmapColorChannel($bmd:BitmapData):BitmapData
[static]
WebView
  
Starts to create a full webpage screenshot.
WebView
  
zoomBy($zoomFactor:Number):void
Performs a zoom operation in this WebView.
WebView
  
zoomIn():Boolean
Performs zoom in in this WebView.
WebView
  
zoomOut():Boolean
Performs zoom out in this WebView.
WebView
Property Detail
backForwardListproperty
backForwardList:Array  [read-only]


Implementation
    public function get backForwardList():Array
chromeClientproperty 
chromeClient:ChromeClient  [read-only]

Gets the chrome handler.


Implementation
    public function get chromeClient():ChromeClient
contentHeightproperty 
contentHeight:int  [read-only]

Gets the height of the HTML content.


Implementation
    public function get contentHeight():int
faviconproperty 
favicon:BitmapData  [read-only]

Gets the favicon for the current page.


Implementation
    public function get favicon():BitmapData
heightproperty 
height:int

Indicates the height of the webview instance


Implementation
    public function get height():int
    public function set height(value:int):void
initialScaleproperty 
initialScale:int  [write-only]

Sets the initial scale for this WebView. 0 means default. The behavior for the default scale depends on the state of _webviewInstance.settings.useWideViewPort() and _webviewInstance.settings.loadWithOverviewMode(). If the content fits into the WebView control by width, then the zoom is set to 100%. For wide content, the behavior depends on the state of _webviewInstance.settings.loadWithOverviewMode(). If its value is true, the content will be zoomed out to be fit by width into the WebView control, otherwise not. If initial scale is greater than 0, WebView starts with this value as initial scale. Please note that unlike the scale properties in the viewport meta tag, this method doesn't take the screen density into account.


Implementation
    public function set initialScale(value:int):void
isPrivateBrowsingEnabledproperty 
isPrivateBrowsingEnabled:Boolean  [read-only]

Gets whether private browsing is enabled in this WebView.


Implementation
    public function get isPrivateBrowsingEnabled():Boolean
originalUrlproperty 
originalUrl:String  [read-only]

Gets the original URL for the current page. This is not always the same as the URL passed to WebViewEvents.PAGE_STARTED because although the load for that URL has begun, the current page may not have changed. Also, there may have been redirects resulting in a different URL to that originally requested.


Implementation
    public function get originalUrl():String
overScrollModeproperty 
overScrollMode:int  [write-only]

Set the over-scroll mode for this view. Valid over-scroll modes are Scroller.OVER_SCROLL_ALWAYS (default), Scroller.OVER_SCROLL_IF_CONTENT_SCROLLS (allow over-scrolling only if the view content is larger than the container), or Scroller.OVER_SCROLL_NEVER. Setting the over-scroll mode of a view will have an effect only if the view is capable of scrolling.


Implementation
    public function set overScrollMode(value:int):void
rendererPriorityWaivedWhenNotVisibleproperty 
rendererPriorityWaivedWhenNotVisible:Boolean  [read-only]

Return whether this WebView requests a priority of RENDERER_PRIORITY_WAIVED when not visible. returns false if Android API is lower than 26


Implementation
    public function get rendererPriorityWaivedWhenNotVisible():Boolean
rendererRequestedPriorityproperty 
rendererRequestedPriority:int  [read-only]

Get the requested renderer priority for this WebView. returns -1 if Android API is lower than 26


Implementation
    public function get rendererRequestedPriority():int
scrollBarStyleproperty 
scrollBarStyle:int  [write-only]

Specify the style of the scrollbars. The scrollbars can be overlaid or inset. When inset, they add to the padding of the view. And the scrollbars can be drawn inside the padding area or on the edge of the view. For example, if a view has a background drawable and you want to draw the scrollbars inside the padding specified by the drawable, you can use Scroller.INSIDE_OVERLAY or Scroller.INSIDE_INSET. If you want them to appear at the edge of the view, ignoring the padding, then you can use Scroller.OUTSIDE_OVERLAY or Scroller.OUTSIDE_INSET.


Implementation
    public function set scrollBarStyle(value:int):void

See also

scrollXproperty 
scrollX:int  [read-only]


Implementation
    public function get scrollX():int
scrollYproperty 
scrollY:int  [read-only]


Implementation
    public function get scrollY():int
settingsproperty 
settings:WebSettings  [read-only]


Implementation
    public function get settings():WebSettings
widthproperty 
width:int

Indicates the width of the webview instance


Implementation
    public function get width():int
    public function set width(value:int):void
xproperty 
x:int

Indicates the x position of the webview instance relative to the main stage


Implementation
    public function get x():int
    public function set x(value:int):void
yproperty 
y:int

Indicates the y position of the webview instance relative to the main stage


Implementation
    public function get y():int
    public function set y(value:int):void
Constructor Detail
WebView()Constructor
public function WebView($ctx:ExtensionContext, $x:int, $y:int, $w:int, $h:int)



Parameters
$ctx:ExtensionContext
 
$x:int
 
$y:int
 
$w:int
 
$h:int
Method Detail
addEventListener()method
override public function addEventListener($type:String, $listener:Function, $useCapture:Boolean = false, $priority:int = 0, $useWeakReference:Boolean = false):void

Parameters

$type:String
 
$listener:Function
 
$useCapture:Boolean (default = false)
 
$priority:int (default = 0)
 
$useWeakReference:Boolean (default = false)

addJavascriptInterface()method 
public function addJavascriptInterface():void

Injects the built-in JS code into the loaded HTML page which makes AIR/HTML communication possible.

addView()method 
public function addView():void

Adds the webview instance to the stage (Native windows will always be placed at the top of AIR content).

callJS()method 
public function callJS($msg:String):void

use this method to call Javascript functions. for example if you have a function in your js like this:

	 function diplayAlert(msg)
	 {
	 		alert(msg);
	 }
	 
you can call it this way:
	 _webviewInstance.callJS("diplayAlert('a msg from flash!')");
	 

Parameters

$msg:String

canGoBack()method 
public function canGoBack():Boolean

A Boolean value indicating whether there is a back item in the back-forward list that can be navigated to.

Returns
Boolean
canGoBackOrForward()method 
public function canGoBackOrForward($steps:int):Boolean

Parameters

$steps:int

Returns
Boolean
canGoForward()method 
public function canGoForward():Boolean

A Boolean value indicating whether there is a forward item in the back-forward list that can be navigated to.

Returns
Boolean
clearCache()method 
public function clearCache($includeDiskFiles:Boolean):void

Clears the resource cache. Note that the cache is per-application, so this will clear the cache for all WebViews used.

Parameters

$includeDiskFiles:Boolean — if false, only the RAM cache is cleared

clearFormData()method 
public function clearFormData():void

Removes the autocomplete popup from the currently focused form field, if present. Note this only affects the display of the autocomplete popup, it does not remove any saved form data from this WebView's store. To do that, use WebViewDatabase.clearFormData().

clearHistory()method 
public function clearHistory():void

Tells this WebView to clear its internal back/forward list.

clearSslPreferences()method 
public function clearSslPreferences():void

Clears the SSL preferences table stored in response to proceeding with SSL certificate errors.

close()method 
public function close():void

closes and removes the webview instance from stage.

createPrintDocumentAdapter()method 
public function createPrintDocumentAdapter($documentName:String):void

Creates a PrintDocumentAdapter that provides the content of this WebView for printing. The adapter works by converting the WebView contents to a PDF stream.

Parameters

$documentName:String

destroy()method 
public function destroy():void

Use close method instead. Destroys the internal state of this WebView. This method should be called after this WebView has been removed from the view system. No other methods may be called on this WebView after destroy.

evaluateJavascript()method 
public function evaluateJavascript($msg:String):void

Asynchronously evaluates JavaScript in the context of the currently displayed page. Result will be returned with the EVALUATE_JS event.

Parameters

$msg:String

flingScroll()method 
public function flingScroll($vx:int, $vy:int):void

Parameters

$vx:int
 
$vy:int

getProgress()method 
public function getProgress():Number

Gets the progress for the current page.

Returns
Number — the progress for the current page between 0 and 100
getTitle()method 
public function getTitle():String

Gets the title for the current page.

Returns
String
getUrl()method 
public function getUrl():String

Gets the URL for the current page. This is not always the same as the URL passed to WebViewClient.onPageStarted because although the load for that URL has begun, the current page may not have changed.

Returns
String — the URL for the current page
goBack()method 
public function goBack():void

Goes back in the history of this WebView.

goForward()method 
public function goForward():void

Goes forward in the history of this WebView.

hide()method 
public function hide():void

makes the webview instance invisible if it is already visible.

invokeZoomPicker()method 
public function invokeZoomPicker():void

Invokes the graphical zoom picker widget for this WebView. This will result in the zoom widget appearing on the screen to control the zoom level of this WebView.

loadData()method 
public function loadData($data:HtmlDataSettings):void

Loads HTML string as a web content. You must construct your HTML string in a HtmlDataSettings object.

Parameters

$data:HtmlDataSettings

loadFile()method 
public function loadFile($file:File):void

Navigates to the requested file on the filesystem.

Parameters

$file:File — The file object to which to navigate.

loadUrl()method 
public function loadUrl($url:String):void

Loads a webpage from a URL. Notice that you should pass URLs starting with 'https://'

Parameters

$url:String

onPause()method 
public function onPause():void

Does a best-effort attempt to pause any processing that can be paused safely, such as animations and geolocation. Note that this call does not pause JavaScript. To pause JavaScript globally, use pauseTimers(). To resume WebView, call onResume().

onResume()method 
public function onResume():void

Resumes a WebView after a previous call to onPause().

pageDown()method 
public function pageDown($bottom:Boolean):void

Scrolls the contents of this WebView down by half the page size.

Parameters

$bottom:Boolean — true to jump to bottom of page

pageUp()method 
public function pageUp($top:Boolean):void

Scrolls the contents of this WebView up by half the view size.

Parameters

$top:Boolean — true to jump to the top of the page

pauseTimers()method 
public function pauseTimers():void

Pauses all layout, parsing, and JavaScript timers for all WebViews. This is a global requests, not restricted to just this WebView. This can be useful if the application has been paused.

postUrl()method 
public function postUrl($url:String, $postData:String):void

Loads the URL with postData using "POST" method into this WebView. If url is not a network URL, it will be loaded with loadUrl(String) instead, ignoring the postData param.

Parameters

$url:String — the URL of the resource to load
 
$postData:String — the data will be passed to "POST" request, which must be be "application/x-www-form-urlencoded" encoded. And finally converted into String using Base64 format.

reload()method 
public function reload():void

Reloads the current URL.

removeEventListener()method 
override public function removeEventListener($type:String, $listener:Function, $useCapture:Boolean = false):void

Parameters

$type:String
 
$listener:Function
 
$useCapture:Boolean (default = false)

requestFocus()method 
public function requestFocus($direction:int):Boolean

Call this to try to give focus to a specific view or to one of its descendants and give it hints about the direction and a specific rectangle that the focus is coming from.

Parameters

$direction:int

Returns
Boolean

See also

resumeTimers()method 
public function resumeTimers():void

Resumes all layout, parsing, and JavaScript timers for all WebViews. This will resume dispatching all timers.

saveWebArchive()method 
public function saveWebArchive($basename:String, $autoname:Boolean):void

Saves the current view as a web archive. When done, WebViewEvents.SAVE_WEB_ARCHIVE will be dispatched

Parameters

$basename:String — the filename where the archive should be placed
 
$autoname:Boolean — if false, takes basename to be a file. If true, basename is assumed to be a directory in which a filename will be chosen according to the URL of the current page.

scrollBy()method 
public function scrollBy(x:int, y:int):void

Parameters

x:int
 
y:int

scrollTo()method 
public function scrollTo(x:int, y:int):void

Parameters

x:int
 
y:int

setBackgroundColor()method 
public function setBackgroundColor($color:String):void

Sets the background color for this view.

Parameters

$color:String

setNetworkAvailable()method 
public function setNetworkAvailable($networkUp:Boolean):void

Informs WebView of the network state. This is used to set the JavaScript property window.navigator.isOnline and generates the online/offline event as specified in HTML5, sec. 5.7.7

Parameters

$networkUp:Boolean — a boolean indicating if network is available

setRendererPriorityPolicy()method 
public function setRendererPriorityPolicy($rendererRequestedPriority:int, $waivedWhenNotVisible:Boolean):void

Set the renderer priority policy for this WebView. The priority policy will be used to determine whether an out of process renderer should be considered to be a target for OOM killing. Because a renderer can be associated with more than one WebView, the final priority it is computed as the maximum of any attached WebViews. When a WebView is destroyed it will cease to be considerered when calculating the renderer priority. Once no WebViews remain associated with the renderer, the priority of the renderer will be reduced to RenderPriority.WAIVED. The default policy is to set the priority to RenderPriority.IMPORTANT regardless of visibility.

Works on Android 26+

Parameters

$rendererRequestedPriority:int — the minimum priority at which this WebView desires the renderer process to be bound.
 
$waivedWhenNotVisible:Boolean — if true, this flag specifies that when this WebView is not visible, it will be treated as if it had requested a priority of RENDERER_PRIORITY_WAIVED.

See also

setViewPort()method 
public function setViewPort($rect:Rectangle):void

set the x,y,width,height of this webview instance.

Parameters

$rect:Rectangle

show()method 
public function show():void

makes the webview instance visible if it is already invisible.

stopLoad()method 
public function stopLoad():void

Stops the current load.

stopLoading()method 
public function stopLoading():void

switchBitmapColorChannel()method 
public static function switchBitmapColorChannel($bmd:BitmapData):BitmapData

Parameters

$bmd:BitmapData

Returns
BitmapData
takeScreenshot()method 
public function takeScreenshot():void

Starts to create a full webpage screenshot. When it's work is completed, the event WebViewEvents.SCREENSHOT will be dispatched.

zoomBy()method 
public function zoomBy($zoomFactor:Number):void

Performs a zoom operation in this WebView.

Parameters

$zoomFactor:Number — the zoom factor to apply. The zoom factor will be clamped to the WebView's zoom limits. This value must be in the range 0.01 to 100.0 inclusive.

zoomIn()method 
public function zoomIn():Boolean

Performs zoom in in this WebView.

Returns
Boolean — true if zoom in succeeds, false if no zoom changes
zoomOut()method 
public function zoomOut():Boolean

Performs zoom out in this WebView.

Returns
Boolean — true if zoom out succeeds, false if no zoom changes