com.tuarua
WebView
flash.events:EventDispatcher
addCallback
functionName
name of the function as called from Javascript
closure
Actionscript function to call when functionName is called from Javascript

Adds a callback in the webView. These should be added before .init() is called.

addEventListener
type
listener
useCapture
false
priority
0
useWeakReference
false
addTab
Windows + OSX only
initialUrl
null
Windows + OSX only
allowsMagnification
Whether the page allows magnification functionality Ignored on iOS.
backForwardList

Ignored on Windows and Android.

com.tuarua.webview:BackForwardList
callJavascriptFunction
functionName
name of the Javascript function to call
closure
null
Actionscript function to call when Javascript functionName is called. If null then no actionscript function is called, aka a 'fire and forget' call.
args
arguments to send to the Javascript function

Call a javascript function.

// Logs to the console. No result expected. webView.callJavascriptFunction("as_to_js",asToJsCallback,1,"a",77);

public function asToJsCallback(jsResult:JavascriptResult):void { trace("asToJsCallback"); trace("jsResult.error", jsResult.error); trace("jsResult.result", jsResult.result); trace("jsResult.message", jsResult.message); trace("jsResult.success", jsResult.success); var testObject:= jsResult.result; trace(testObject); }
// Calls Javascript function passing 3 args. Javascript function returns an // object which is automatically mapped to an // Actionscript Object webView.callJavascriptFunction("console.log",null,"hello console. The is AIR");

// function in HTML page function as_to_js(numberA, stringA, numberB, obj) { var person = { name: "Jim Cowart", response: { name: "Chattanooga", population: 167674 } }; return person; }
capture
Captures the webView to BitmapData.
onComplete
function(result:BitmapData)
cropTo
null
optionally crops to the supplied Rectangle
Captures the webView to BitmapData.

clearCache
Clears the browser cache.
Clears the browser cache. Available on iOS, OSX, Android only.

Ignored on Windows.

You cannot clear the cache on Windows while CEF is running. This is a known limitation. You can delete the contents of the value of your settings.cef.cachePath using Actionscript only before you call .init(). Calling after .dispose() may cause file locks as the files may still be 'owned' by the CEF process

clearRequestHeaders
Clears any persistent requestHeaders added to URLRequest
Clears any persistent requestHeaders added to URLRequest
closeDevTools
Close the Chromium dev tools Disables Inspect Element on right click on OSX On Android disconnects from chrome://inspect
Close the Chromium dev tools

Disables Inspect Element on right click on OSX

On Android disconnects from chrome://inspect

closeTab
Windows + OSX only
index
Windows + OSX only
deleteCookies
Deletes all cookies
Deletes all cookies
dispose
Disposes the ANE
Disposes the ANE
evaluateJavascript
code
Javascript string to evaluate.
closure
null
Actionscript function to call when the Javascript string is evaluated. If null then no actionscript function is called, aka a 'fire and forget' call.

// Set the body background to yellow. No result expected webView.evaluateJavascript('document.getElementsByTagName("body")[0].style.backgroundColor = "yellow";');
// Retrieve contents of div. Result is returned to Actionscript function 'onJsEvaluated' webView.evaluateJavascript("document.getElementById('output').innerHTML;", onJsEvaluated) private function onJsEvaluated(jsResult:JavascriptResult):void { trace("innerHTML of div is:", jsResult.result); }
focus
goBack
Navigates back.
Navigates back.
goForward
Navigates forward.
Navigates forward.
go
offset
1
Navigate forward (eg +1) or back (eg -1)

init
stage
viewPort
initialUrl
null
Url to load when the view loads
settings
com.tuarua.webview:Settings
null
scaleFactor
1.0
iOS, Android only
backgroundColor
0xFFFFFFFF
value of the view's background color in ARGB format.

Initialises the webView. N.B. The webView is set to visible = false initially.

injectScript
code
null
Javascript to inject, if any.
scriptUrl
null
is the URL where the script in question can be found, if any. Windows only
startLine
0
is the base line number to use for error reporting. Windows only

Specify either code or scriptUrl. These are injected into the main Frame when it is loaded. Call before load() method

Ignored on Android.

loadFileURL
url
full path to the file on the local file system
allowingReadAccessTo
path to the root of the document

Loads a file from the local file system into the webView.

loadHTMLString
html
HTML provided as a string
baseUrl
null
url which will display as the address

Loads a HTML string into the webView.

load
url
printToPdf
savePath
path to save the pdf to.

Prints the webView to a pdf.

Windows only.

print
Prints the webView.
Prints the webView.

Windows only.

reloadFromOrigin
Forces a reload of the page (i.e.
Forces a reload of the page (i.e. ctrl F5)
reload
Reloads the current page.
Reloads the current page.
removeCallback
functionName
name of the function to remove. This function should have been added via .addCallback() method

removeEventListener
type
listener
useCapture
false
shared
com.tuarua:WebView
showDevTools
Shows the Chromium dev tools on Windows Enables Inspect Element on right click on OSX On Android use Chrome on connected computer and navigate to chrome://inspect
Shows the Chromium dev tools on Windows

Enables Inspect Element on right click on OSX

On Android use Chrome on connected computer and navigate to chrome://inspect

stopLoading
Stops loading the current page.
Stops loading the current page.
zoomIn
Zooms in

Zooms in

zoomOut
Zooms out
Zooms out
currentTab
Windows + OSX only
Windows + OSX only
tabDetails
viewPort
visible