Packagefeathers.controls
Classpublic class WebView
InheritanceWebView Inheritance FeathersControl Inheritance starling.display.Sprite

A Feathers component that displays a web browser in Adobe AIR, using the flash.media.StageWebView class.

Warning: This component is only compatible with Adobe AIR. It cannot be used with Adobe Flash Player in a web browser.

See also

How to use the Feathers WebView component


Public Properties
 PropertyDefined By
 InheriteddefaultTextEditorFactory : Function
[static] A function used by all UI controls that support text editor to create an ITextEditor instance.
FeathersControl
 InheriteddefaultTextRendererFactory : Function
[static] A function used by all UI controls that support text renderers to create an ITextRenderer instance.
FeathersControl
 Inheriteddepth : int
[read-only] The component's depth in the display list, relative to the stage.
FeathersControl
 InheritedfocusIndicatorSkin : DisplayObject
If this component supports focus, this optional skin will be displayed above the component when showFocus() is called.
FeathersControl
 InheritedfocusManager : IFocusManager
FeathersControl
 InheritedfocusOwner : IFocusDisplayObject
FeathersControl
 InheritedfocusPadding : Number
Quickly sets all focus padding properties to the same value.
FeathersControl
 InheritedfocusPaddingBottom : Number
The minimum space, in pixels, between the object's bottom edge and the bottom edge of the focus indicator skin.
FeathersControl
 InheritedfocusPaddingLeft : Number
The minimum space, in pixels, between the object's left edge and the left edge of the focus indicator skin.
FeathersControl
 InheritedfocusPaddingRight : Number
The minimum space, in pixels, between the object's right edge and the right edge of the focus indicator skin.
FeathersControl
 InheritedfocusPaddingTop : Number
The minimum space, in pixels, between the object's top edge and the top edge of the focus indicator skin.
FeathersControl
 Inheritedheight : Number
[override] The height of the component, in pixels.
FeathersControl
 InheritedincludeInLayout : Boolean
Determines if the ILayout should use this object or ignore it.
FeathersControl
 InheritedisCreated : Boolean
[read-only] Determines if the component has been initialized and validated for the first time.
FeathersControl
 InheritedisEnabled : Boolean
Indicates whether the control is interactive or not.
FeathersControl
 InheritedisFocusEnabled : Boolean
FeathersControl
  isHistoryBackEnabled : Boolean
[read-only] Indicates if the web view can navigate back in its history.
WebView
  isHistoryForwardEnabled : Boolean
[read-only] Indicates if the web view can navigate forward in its history.
WebView
 InheritedisInitialized : Boolean
[read-only] Determines if the component has been initialized yet.
FeathersControl
 InheritedisQuickHitAreaEnabled : Boolean
Similar to mouseChildren on the classic display list.
FeathersControl
  isSupported : Boolean
[static] [read-only] Indicates if this component is supported on the current platform.
WebView
 InheritedlayoutData : ILayoutData
Extra parameters associated with this display object that will be used by the layout algorithm.
FeathersControl
  location : String
[read-only] The URL of the currently loaded page.
WebView
 InheritedmaxHeight : Number
The maximum recommended height to be used for self-measurement and, optionally, by any code that is resizing this component.
FeathersControl
 InheritedmaxWidth : Number
The maximum recommended width to be used for self-measurement and, optionally, by any code that is resizing this component.
FeathersControl
 InheritedminHeight : Number
The minimum recommended height to be used for self-measurement and, optionally, by any code that is resizing this component.
FeathersControl
 InheritedminTouchHeight : Number
If using isQuickHitAreaEnabled, and the hit area's height is smaller than this value, it will be expanded.
FeathersControl
 InheritedminTouchWidth : Number
If using isQuickHitAreaEnabled, and the hit area's width is smaller than this value, it will be expanded.
FeathersControl
 InheritedminWidth : Number
The minimum recommended width to be used for self-measurement and, optionally, by any code that is resizing this component.
FeathersControl
 InheritednextTabFocus : IFocusDisplayObject
FeathersControl
 InheritedpreviousTabFocus : IFocusDisplayObject
FeathersControl
 InheritedstyleName : String
The concatenated styleNameList, with values separated by spaces.
FeathersControl
 InheritedstyleNameList : TokenList
[read-only] Contains a list of all "styles" assigned to this control.
FeathersControl
 InheritedstyleProvider : IStyleProvider
When a component initializes, a style provider may be used to set properties that affect the component's visual appearance.
FeathersControl
  title : String
[read-only] The title of the currently loaded page.
WebView
  useNative : Boolean
Determines if the system native web browser control is used or if Adobe AIR's embedded version of the WebKit engine is used.
WebView
 Inheritedwidth : Number
[override] The width of the component, in pixels.
FeathersControl
Protected Properties
 PropertyDefined By
 InheritedactualHeight : Number = 0
The final height value that should be used for layout.
FeathersControl
 InheritedactualWidth : Number = 0
The final width value that should be used for layout.
FeathersControl
 InheriteddefaultStyleProvider : IStyleProvider
[read-only] When the FeathersControl constructor is called, the globalStyleProvider property is set to this value.
FeathersControl
 InheritedexplicitHeight : Number = NaN
The height value explicitly set by calling the height setter or setSize().
FeathersControl
 InheritedexplicitWidth : Number = NaN
The width value explicitly set by calling the width setter or setSize().
FeathersControl
Public Methods
 MethodDefined By
  
Constructor.
WebView
 Inherited
hideFocus():void
If the visual indicator of focus has been displayed by showFocus(), call this function to hide it.
FeathersControl
  
Navigates to the previous page in the browsing history.
WebView
  
Navigates to the next page in the browsing history.
WebView
 Inherited
invalidate(flag:String):void
Call this function to tell the UI control that a redraw is pending.
FeathersControl
 Inherited
isInvalid(flag:String = null):Boolean
Indicates whether the control is pending validation or not.
FeathersControl
  
loadString(text:String, mimeType:String = text/html):void
Renders the specified HTML or XHTML string.
WebView
  
loadURL(url:String):void
Loads the specified URL.
WebView
 Inherited
move(x:Number, y:Number):void
Sets both the x and the y positions of the control in a single function call.
FeathersControl
  
reload():void
Reloads the currently loaded page.
WebView
 Inherited
setSize(width:Number, height:Number):void
Sets both the width and the height of the control in a single function call.
FeathersControl
 Inherited
showFocus():void
If the object has focus, an additional visual indicator may optionally be displayed to highlight the object.
FeathersControl
  
stop():void
Stops the current page from loading.
WebView
 Inherited
validate():void
Immediately validates the display object, if it is invalid.
FeathersControl
Protected Methods
 MethodDefined By
  
If the component's dimensions have not been set explicitly, it will measure its content and determine an ideal size for itself.
WebView
 Inherited
clearInvalidationFlag(flag:String):void
Clears an invalidation flag.
FeathersControl
  
Creates the StageWebView instance.
WebView
 Inherited
draw():void
Override to customize layout and to adjust properties of children.
FeathersControl
 Inherited
focusInHandler(event:Event):void
Default event handler for FeathersEventType.FOCUS_IN that may be overridden in subclasses to perform additional actions when the component receives focus.
FeathersControl
 Inherited
focusOutHandler(event:Event):void
Default event handler for FeathersEventType.FOCUS_OUT that may be overridden in subclasses to perform additional actions when the component loses focus.
FeathersControl
 Inherited
initialize():void
Called the first time that the UI control is added to the stage, and you should override this function to customize the initialization process.
FeathersControl
 Inherited
Updates the focus indicator skin by showing or hiding it and adjusting its position and dimensions.
FeathersControl
 Inherited
setInvalidationFlag(flag:String):void
Sets an invalidation flag.
FeathersControl
 Inherited
setSizeInternal(width:Number, height:Number, canInvalidate:Boolean):Boolean
Sets the width and height of the control, with the option of invalidating or not.
FeathersControl
  
WebView
Events
 Event Summary Defined By
  Dispatched when a URL has finished loading with loadURL() or a string has finished loading with loadString().WebView
 InheritedDispatched after the component has validated for the first time.FeathersControl
  Indicates that an error occurred in the StageWebView.WebView
 InheritedDispatched after initialize() has been called, but before the first time that draw() has been called.FeathersControl
  Indicates that the location property has changed.WebView
 InheritedDispatched when the width or height of the control changes.FeathersControl
Public Constants
 ConstantDefined By
 InheritedINVALIDATION_FLAG_ALL : String = all
[static] Flag to indicate that everything is invalid and should be redrawn.
FeathersControl
 InheritedINVALIDATION_FLAG_DATA : String = data
[static] Invalidation flag to indicate that the primary data displayed by the UI control has changed.
FeathersControl
 InheritedINVALIDATION_FLAG_FOCUS : String = focus
[static] Invalidation flag to indicate that the focus of the UI control has changed.
FeathersControl
 InheritedINVALIDATION_FLAG_LAYOUT : String = layout
[static] Invalidation flag to indicate that the layout of the UI control has changed.
FeathersControl
 InheritedINVALIDATION_FLAG_SCROLL : String = scroll
[static] Invalidation flag to indicate that the scroll position of the UI control has changed.
FeathersControl
 InheritedINVALIDATION_FLAG_SELECTED : String = selected
[static] Invalidation flag to indicate that the selection of the UI control has changed.
FeathersControl
 InheritedINVALIDATION_FLAG_SIZE : String = size
[static] Invalidation flag to indicate that the dimensions of the UI control have changed.
FeathersControl
 InheritedINVALIDATION_FLAG_SKIN : String = skin
[static] Invalidation flag to indicate that the skin of the UI control has changed.
FeathersControl
 InheritedINVALIDATION_FLAG_STATE : String = state
[static] Invalidation flag to indicate that the state has changed.
FeathersControl
 InheritedINVALIDATION_FLAG_STYLES : String = styles
[static] Invalidation flag to indicate that the styles or visual appearance of the UI control has changed.
FeathersControl
Property Detail
isHistoryBackEnabledproperty
isHistoryBackEnabled:Boolean  [read-only]

Indicates if the web view can navigate back in its history.


Implementation
    public function get isHistoryBackEnabled():Boolean

See also

isHistoryForwardEnabledproperty 
isHistoryForwardEnabled:Boolean  [read-only]

Indicates if the web view can navigate forward in its history.


Implementation
    public function get isHistoryForwardEnabled():Boolean

See also

isSupportedproperty 
isSupported:Boolean  [read-only]

Indicates if this component is supported on the current platform.


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

The URL of the currently loaded page.


Implementation
    public function get location():String

See also

titleproperty 
title:String  [read-only]

The title of the currently loaded page.


Implementation
    public function get title():String

See also

useNativeproperty 
useNative:Boolean

Determines if the system native web browser control is used or if Adobe AIR's embedded version of the WebKit engine is used.

Note: Although it is not prohibited, with some content, failures can occur when the same process uses both the embedded and the system WebKit, so it is recommended that all StageWebViews in a given application be constructed with the same value for useNative. In addition, as HTMLLoader depends on the embedded WebKit, applications using HTMLLoader should only construct StageWebViews with useNative set to false.


Implementation
    public function get useNative():Boolean
    public function set useNative(value:Boolean):void
Constructor Detail
WebView()Constructor
public function WebView()

Constructor.

Method Detail
autoSizeIfNeeded()method
protected function autoSizeIfNeeded():Boolean

If the component's dimensions have not been set explicitly, it will measure its content and determine an ideal size for itself. If the explicitWidth or explicitHeight member variables are set, those value will be used without additional measurement. If one is set, but not the other, the dimension with the explicit value will not be measured, but the other non-explicit dimension will still need measurement.

Calls setSizeInternal() to set up the actualWidth and actualHeight member variables used for layout.

Meant for internal use, and subclasses may override this function with a custom implementation.

Returns
Boolean
createStageWebView()method 
protected function createStageWebView():void

Creates the StageWebView instance.

Meant for internal use, and subclasses may override this function with a custom implementation.

historyBack()method 
public function historyBack():void

Navigates to the previous page in the browsing history.

See also

historyForward()method 
public function historyForward():void

Navigates to the next page in the browsing history.

See also

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

Renders the specified HTML or XHTML string.

Parameters

text:String
 
mimeType:String (default = text/html)

See also

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

Loads the specified URL.

Parameters

url:String

See also

reload()method 
public function reload():void

Reloads the currently loaded page.

See also

stageWebView_completeHandler()method 
protected function stageWebView_completeHandler(event:Event):void

Parameters

event:Event

stop()method 
public function stop():void

Stops the current page from loading.

See also

Event Detail
complete Event
Event Object Type: starling.events.Event
Event.type property = starling.events.Event.COMPLETE

Dispatched when a URL has finished loading with loadURL() or a string has finished loading with loadString().

The properties of the event object have the following values:

PropertyValue
bubblesfalse
currentTargetThe Object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
datanull
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.

See also

error Event  
Event Object Type: starling.events.Event
Event.type property = feathers.events.FeathersEventType.ERROR

Indicates that an error occurred in the StageWebView.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
currentTargetThe Object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
dataThe flash.events.ErrorEvent dispatched by the StageWebView.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.

The FeathersEventType.ERROR event type is used by Feathers controls when an error occurs that can be caught and safely ignored.
locationChange Event  
Event Object Type: starling.events.Event
Event.type property = feathers.events.FeathersEventType.LOCATION_CHANGE

Indicates that the location property has changed.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
currentTargetThe Object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
datanull
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.

The FeathersEventType.LOCATION_CHANGE event type is used by the Feathers WebView component to indicate that its location has changed.

See also