Adobe® Flex® 4 Language Reference
Hide Packages and Classes List |  Packages  |  Classes  |  Index  |  Appendixes
flash.html 
HTMLLoader 
Packageflash.html
Classpublic class HTMLLoader
InheritanceHTMLLoader Inheritance Sprite Inheritance DisplayObjectContainer Inheritance InteractiveObject Inheritance DisplayObject Inheritance EventDispatcher Inheritance Object
Subclasses FlexHTMLLoader

Runtime Versions: AIR 1.0

The HTMLLoader class defines a type of display object that is a container for HTML content.

The default dimensions of an HTMLLoader are 0 x 0 pixels. Set the width and height properties to make the HTMLLoader object visible.

The maximum size for an HTMLLoader object is 2,880 pixels in height and 2,880 pixels in width. Setting width or height of an HTMLLoader object to a number that exceeds the limitation causes the HTMLLoader object to throw an ArgumentError exception.

View the examples



Public Properties
 PropertyDefined By
 InheritedaccessibilityImplementation : AccessibilityImplementation
The current accessibility implementation (AccessibilityImplementation) for this InteractiveObject instance.
InteractiveObject
 InheritedaccessibilityProperties : AccessibilityProperties
The current accessibility options for this display object.
DisplayObject
 Inheritedalpha : Number
Indicates the alpha transparency value of the object specified.
DisplayObject
  AIR-only authenticate : Boolean
Specifies whether authentication requests should be handled (true) or not (false) for HTTP requests issued by this object.
HTMLLoader
 InheritedblendMode : String
A value from the BlendMode class that specifies which blend mode to use.
DisplayObject
 InheritedblendShader : Shader
[write-only] Sets a shader that is used for blending the foreground and background.
DisplayObject
 InheritedbuttonMode : Boolean
Specifies the button mode of this sprite.
Sprite
 InheritedcacheAsBitmap : Boolean
If set to true, Flash Player or Adobe AIR caches an internal bitmap representation of the display object.
DisplayObject
  AIR-only cacheResponse : Boolean
Specifies whether successful response data should be cached for HTTP requests issued by this object.
HTMLLoader
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  AIR-only contentHeight : Number
[read-only] The height, in pixels, of the HTML content.
HTMLLoader
  AIR-only contentWidth : Number
[read-only] The width, in pixels, of the HTML content.
HTMLLoader
 InheritedcontextMenu : NativeMenu
Specifies the context menu associated with this object.
InteractiveObject
 InheriteddoubleClickEnabled : Boolean
Specifies whether the object receives doubleClick events.
InteractiveObject
 InheriteddropTarget : DisplayObject
[read-only] Specifies the display object over which the sprite is being dragged, or on which the sprite was dropped.
Sprite
 Inheritedfilters : Array
An indexed array that contains each filter object currently associated with the display object.
DisplayObject
 InheritedfocusRect : Object
Specifies whether this object displays a focus rectangle.
InteractiveObject
 Inheritedgraphics : Graphics
[read-only] Specifies the Graphics object that belongs to this sprite where vector drawing commands can occur.
Sprite
  AIR-only hasFocusableContent : Boolean
[read-only] Indicates whether any content in the HTMLLoader object is focusable.
HTMLLoader
  AIR-only height : Number
[override] Specifies the height of the rectangle of the HTML canvas that is being rendered.
HTMLLoader
  AIR-only historyLength : uint
[read-only] The overall length of the history list, including back and forward entries.
HTMLLoader
  AIR-only historyPosition : uint
The current position in the history list.
HTMLLoader
 InheritedhitArea : Sprite
Designates another sprite to serve as the hit area for a sprite.
Sprite
  AIR-only htmlHost : flash.html:HTMLHost
The HTMLHost object used to handle changes to certain user interface elements, such as the window.document.title property of the HTMLLoader object.
HTMLLoader
  AIR-only loaded : Boolean
[read-only] Indicates whether the JavaScript load event corresponding to the previous call to the load() or loadString() method has been delivered to the HTML DOM in the HTMLLoader object.
HTMLLoader
 InheritedloaderInfo : LoaderInfo
[read-only] Returns a LoaderInfo object containing information about loading the file to which this display object belongs.
DisplayObject
  AIR-only location : String
[read-only] The URL for the content loaded in the HTMLLoader object.
HTMLLoader
  AIR-only manageCookies : Boolean
Specifies whether the HTTP protocol stack should manage cookies for this object.
HTMLLoader
 Inheritedmask : DisplayObject
The calling display object is masked by the specified mask object.
DisplayObject
 InheritedmouseChildren : Boolean
Determines whether or not the children of the object are mouse enabled.
DisplayObjectContainer
 InheritedmouseEnabled : Boolean
Specifies whether this object receives mouse messages.
InteractiveObject
 InheritedmouseX : Number
[read-only] Indicates the x coordinate of the mouse position, in pixels.
DisplayObject
 InheritedmouseY : Number
[read-only] Indicates the y coordinate of the mouse position, in pixels.
DisplayObject
 Inheritedname : String
Indicates the instance name of the DisplayObject.
DisplayObject
  AIR-only navigateInSystemBrowser : Boolean
Specifies whether navigation of the root frame of the HTML content (such as when the user clicks a link, when the window.location property is set, or when calling window.open()) results in navigation in the HTMLLoader object (false) or in the default system web browser (true).
HTMLLoader
 InheritednumChildren : int
[read-only] Returns the number of children of this object.
DisplayObjectContainer
 InheritedopaqueBackground : Object
Specifies whether the display object is opaque with a certain background color.
DisplayObject
  AIR-only paintsDefaultBackground : Boolean
Specifies whether the background of the HTMLLoader document is opaque white (true) or not (false).
HTMLLoader
 Inheritedparent : DisplayObjectContainer
[read-only] Indicates the DisplayObjectContainer object that contains this display object.
DisplayObject
  AIR-only pdfCapability : int
[static] [read-only] The type of PDF support on the user's system, defined as an integer code value.
HTMLLoader
  AIR-only placeLoadStringContentInApplicationSandbox : Boolean
Specifies whether content loaded via the loadString() method is put in the application sandbox (true) or in a non-application sandbox (false).
HTMLLoader
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
 Inheritedroot : DisplayObject
[read-only] For a display object in a loaded SWF file, the root property is the top-most display object in the portion of the display list's tree structure represented by that SWF file.
DisplayObject
 Inheritedrotation : Number
Indicates the rotation of the DisplayObject instance, in degrees, from its original orientation.
DisplayObject
 InheritedrotationX : Number
Indicates the x-axis rotation of the DisplayObject instance, in degrees, from its original orientation relative to the 3D parent container.
DisplayObject
 InheritedrotationY : Number
Indicates the y-axis rotation of the DisplayObject instance, in degrees, from its original orientation relative to the 3D parent container.
DisplayObject
 InheritedrotationZ : Number
Indicates the z-axis rotation of the DisplayObject instance, in degrees, from its original orientation relative to the 3D parent container.
DisplayObject
  AIR-only runtimeApplicationDomain : ApplicationDomain
The application domain to use for the window.runtime object in JavaScript in the HTML page.
HTMLLoader
 Inheritedscale9Grid : Rectangle
The current scaling grid that is in effect.
DisplayObject
 InheritedscaleX : Number
Indicates the horizontal scale (percentage) of the object as applied from the registration point.
DisplayObject
 InheritedscaleY : Number
Indicates the vertical scale (percentage) of an object as applied from the registration point of the object.
DisplayObject
 InheritedscaleZ : Number
Indicates the depth scale (percentage) of an object as applied from the registration point of the object.
DisplayObject
  AIR-only scrollH : Number
The horizontal scroll position of the HTML content in the HTMLLoader object.
HTMLLoader
 InheritedscrollRect : Rectangle
The scroll rectangle bounds of the display object.
DisplayObject
  AIR-only scrollV : Number
The vertical scroll position of the HTML content in the HTMLLoader object.
HTMLLoader
 InheritedsoundTransform : flash.media:SoundTransform
Controls sound within this sprite.
Sprite
 Inheritedstage : Stage
[read-only] The Stage of the display object.
DisplayObject
 InheritedtabChildren : Boolean
Determines whether the children of the object are tab enabled.
DisplayObjectContainer
 InheritedtabEnabled : Boolean
Specifies whether this object is in the tab order.
InteractiveObject
 InheritedtabIndex : int
Specifies the tab ordering of objects in a SWF file.
InteractiveObject
  AIR-only textEncodingFallback : String
The character encoding used by the HTMLLoader content if an HTML page does not specify a character encoding.
HTMLLoader
  AIR-only textEncodingOverride : String
The character encoding used by the HTMLLoader content, overriding any setting in the HTML page.
HTMLLoader
 InheritedtextSnapshot : flash.text:TextSnapshot
[read-only] Returns a TextSnapshot object for this DisplayObjectContainer instance.
DisplayObjectContainer
 Inheritedtransform : flash.geom:Transform
An object with properties pertaining to a display object's matrix, color transform, and pixel bounds.
DisplayObject
  AIR-only useCache : Boolean
Specifies whether the local cache should be consulted before HTTP requests issued by this object fetch data.
HTMLLoader
 InheriteduseHandCursor : Boolean
A Boolean value that indicates whether the pointing hand (hand cursor) appears when the mouse rolls over a sprite in which the buttonMode property is set to true.
Sprite
  AIR-only userAgent : String
The user agent string to be used in any upcoming content requests from this HTMLLoader object.
HTMLLoader
 Inheritedvisible : Boolean
Whether or not the display object is visible.
DisplayObject
  AIR-only width : Number
[override] Specifies the width of the rectangle of the HTML canvas that is being rendered.
HTMLLoader
  AIR-only window : Object
[read-only] The global JavaScript object for the content loaded into the HTML control.
HTMLLoader
 Inheritedx : Number
Indicates the x coordinate of the DisplayObject instance relative to the local coordinates of the parent DisplayObjectContainer.
DisplayObject
 Inheritedy : Number
Indicates the y coordinate of the DisplayObject instance relative to the local coordinates of the parent DisplayObjectContainer.
DisplayObject
 Inheritedz : Number
Indicates the z coordinate position along the z-axis of the DisplayObject instance relative to the 3D parent container.
DisplayObject
Public Methods
 MethodDefined By
  
Creates an HTMLLoader object.
HTMLLoader
 Inherited
Adds a child DisplayObject instance to this DisplayObjectContainer instance.
DisplayObjectContainer
 Inherited
Adds a child DisplayObject instance to this DisplayObjectContainer instance.
DisplayObjectContainer
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event.
EventDispatcher
 Inherited
Indicates whether the security restrictions would cause any display objects to be omitted from the list returned by calling the DisplayObjectContainer.getObjectsUnderPoint() method with the specified point point.
DisplayObjectContainer
  
Cancels any load operation in progress.
HTMLLoader
 Inherited
Determines whether the specified display object is a child of the DisplayObjectContainer instance or the instance itself.
DisplayObjectContainer
  
AIR-only createRootWindow(visible:Boolean = true, windowInitOptions:NativeWindowInitOptions = null, scrollBarsVisible:Boolean = true, bounds:Rectangle = null):flash.html:HTMLLoader
[static] Creates a new NativeWindow object that contains an HTMLLoader object.
HTMLLoader
 Inherited
Dispatches an event into the event flow.
EventDispatcher
 Inherited
getBounds(targetCoordinateSpace:DisplayObject):Rectangle
Returns a rectangle that defines the area of the display object relative to the coordinate system of the targetCoordinateSpace object.
DisplayObject
 Inherited
Returns the child display object instance that exists at the specified index.
DisplayObjectContainer
 Inherited
Returns the child display object that exists with the specified name.
DisplayObjectContainer
 Inherited
Returns the index position of a child DisplayObject instance.
DisplayObjectContainer
  
Returns the history entry at the specified position.
HTMLLoader
 Inherited
Returns an array of objects that lie under the specified point and are children (or grandchildren, and so on) of this DisplayObjectContainer instance.
DisplayObjectContainer
 Inherited
getRect(targetCoordinateSpace:DisplayObject):Rectangle
Returns a rectangle that defines the boundary of the display object, based on the coordinate system defined by the targetCoordinateSpace parameter, excluding any strokes on shapes.
DisplayObject
 Inherited
Converts the point object from the Stage (global) coordinates to the display object's (local) coordinates.
DisplayObject
 Inherited
Converts a two-dimensional point from the Stage (global) coordinates to a three-dimensional display object's (local) coordinates.
DisplayObject
 Inherited
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
EventDispatcher
 Inherited
Indicates whether an object has a specified property defined.
Object
  
Navigates back in the browser history, if possible.
HTMLLoader
  
Navigates forward in the browser history, if possible.
HTMLLoader
  
AIR-only historyGo(steps:int):void
Navigates the specified number of steps in the browser history.
HTMLLoader
 Inherited
Evaluates the bounding box of the display object to see if it overlaps or intersects with the bounding box of the obj display object.
DisplayObject
 Inherited
hitTestPoint(x:Number, y:Number, shapeFlag:Boolean = false):Boolean
Evaluates the display object to see if it overlaps or intersects with the point specified by the x and y parameters.
DisplayObject
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
  
AIR-only load(urlRequestToLoad:URLRequest):void
Loads the HTMLLoader object with data from the site specified by the urlRequestToLoad parameter.
HTMLLoader
  
AIR-only loadString(htmlContent:String):void
Loads the HTMLLoader object with the HTML content contained in the HTML string.
HTMLLoader
 Inherited
Converts a three-dimensional point of the three-dimensional display object's (local) coordinates to a two-dimensional point in the Stage (global) coordinates.
DisplayObject
 Inherited
Converts the point object from the display object's (local) coordinates to the Stage (global) coordinates.
DisplayObject
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
  
Reloads the page from the current location.
HTMLLoader
 Inherited
Removes the specified child DisplayObject instance from the child list of the DisplayObjectContainer instance.
DisplayObjectContainer
 Inherited
Removes a child DisplayObject from the specified index position in the child list of the DisplayObjectContainer.
DisplayObjectContainer
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
EventDispatcher
 Inherited
Changes the position of an existing child in the display object container.
DisplayObjectContainer
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
startDrag(lockCenter:Boolean = false, bounds:Rectangle = null):void
Lets the user drag the specified sprite.
Sprite
 Inherited
Ends the startDrag() method.
Sprite
 Inherited
Swaps the z-order (front-to-back order) of the two specified child objects.
DisplayObjectContainer
 Inherited
swapChildrenAt(index1:int, index2:int):void
Swaps the z-order (front-to-back order) of the child objects at the two specified index positions in the child list.
DisplayObjectContainer
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
 Inherited
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
EventDispatcher
Events
 Event Summary Defined By
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active.EventDispatcher
 InheritedDispatched when a display object is added to the display list.DisplayObject
 InheritedDispatched when a display object is added to the on stage display list, either directly or through the addition of a sub tree in which the display object is contained.DisplayObject
 InheritedDispatched when the user selects 'Clear' (or 'Delete') from the text context menu.InteractiveObject
 InheritedDispatched when a user presses and releases the main button of the user's pointing device over the same InteractiveObject.InteractiveObject
  Signals that the last load operation requested by loadString or load method has completed.HTMLLoader
 InheritedDispatched when a user gesture triggers the context menu associated with this interactive object in an AIR application.InteractiveObject
 InheritedDispatched when the user activates the platform specific accelerator key combination for a copy operation or selects 'Copy' from the text context menu.InteractiveObject
 InheritedDispatched when the user activates the platform specific accelerator key combination for a cut operation or selects 'Cut' from the text context menu.InteractiveObject
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive.EventDispatcher
 InheritedDispatched when a user presses and releases the main button of a pointing device twice in rapid succession over the same InteractiveObject when that object's doubleClickEnabled flag is set to true.InteractiveObject
 Inherited[broadcast event] Dispatched when the playhead is entering a new frame.DisplayObject
 Inherited[broadcast event] Dispatched when the playhead is exiting the current frame.DisplayObject
 InheritedDispatched after a display object gains focus.InteractiveObject
 InheritedDispatched after a display object loses focus.InteractiveObject
 Inherited[broadcast event] Dispatched after the constructors of frame display objects have run but before frame scripts have run.DisplayObject
  Signals that one or both of the contentWidth and contentHeight properties of the HTMLLoader object has changed.HTMLLoader
  Signals that the HTML DOM has been created in response to a load operation.HTMLLoader
  Signals that the rendering of content in the HTMLLoader object is fully up to date.HTMLLoader
 InheritedDispatched when the user presses a key.InteractiveObject
 InheritedDispatched when the user attempts to change focus by using keyboard navigation.InteractiveObject
 InheritedDispatched when the user releases a key.InteractiveObject
  Signals that the location property of the HTMLLoader object has changed.HTMLLoader
 InheritedDispatched when a user presses and releases the middle button of the user's pointing device over the same InteractiveObject.InteractiveObject
 InheritedDispatched when a user presses the middle pointing device button over an InteractiveObject instance.InteractiveObject
 InheritedDispatched when a user releases the pointing device button over an InteractiveObject instance.InteractiveObject
 InheritedDispatched when a user presses the pointing device button over an InteractiveObject instance.InteractiveObject
 InheritedDispatched when the user attempts to change focus by using a pointer device.InteractiveObject
 InheritedDispatched when a user moves the pointing device while it is over an InteractiveObject.InteractiveObject
 InheritedDispatched when the user moves a pointing device away from an InteractiveObject instance.InteractiveObject
 InheritedDispatched when the user moves a pointing device over an InteractiveObject instance.InteractiveObject
 InheritedDispatched when a user releases the pointing device button over an InteractiveObject instance.InteractiveObject
 InheritedDispatched when a mouse wheel is spun over an InteractiveObject instance.InteractiveObject
 InheritedDispatched by the drag initiator InteractiveObject when the user releases the drag gesture.InteractiveObject
 InheritedDispatched by the target InteractiveObject when a dragged object is dropped on it and the drop has been accepted with a call to DragManager.acceptDragDrop().InteractiveObject
 InheritedDispatched by an InteractiveObject when a drag gesture enters its boundary.InteractiveObject
 InheritedDispatched by an InteractiveObject when a drag gesture leaves its boundary.InteractiveObject
 InheritedDispatched by an InteractiveObject continually while a drag gesture remains within its boundary.InteractiveObject
 InheritedDispatched at the beginning of a drag operation by the InteractiveObject that is specified as the drag initiator in the DragManager.doDrag() call.InteractiveObject
 InheritedDispatched during a drag operation by the InteractiveObject that is specified as the drag initiator in the DragManager.doDrag() call.InteractiveObject
 InheritedDispatched when the user activates the platform specific accelerator key combination for a paste operation or selects 'Paste' from the text context menu.InteractiveObject
 InheritedDispatched when a display object is about to be removed from the display list.DisplayObject
 InheritedDispatched when a display object is about to be removed from the display list, either directly or through the removal of a sub tree in which the display object is contained.DisplayObject
 Inherited[broadcast event] Dispatched when the display list is about to be updated and rendered.DisplayObject
 InheritedDispatched when a user presses and releases the right button of the user's pointing device over the same InteractiveObject.InteractiveObject
 InheritedDispatched when a user presses the pointing device button over an InteractiveObject instance.InteractiveObject
 InheritedDispatched when a user releases the pointing device button over an InteractiveObject instance.InteractiveObject
 InheritedDispatched when the user moves a pointing device away from an InteractiveObject instance.InteractiveObject
 InheritedDispatched when the user moves a pointing device over an InteractiveObject instance.InteractiveObject
  Signals that the scrollH or scrollV property has been changed by the HTMLLoader object.HTMLLoader
 InheritedDispatched when the user activates the platform specific accelerator key combination for a select all operation or selects 'Select All' from the text context menu.InteractiveObject
 InheritedDispatched when the value of the object's tabChildren flag changes.InteractiveObject
 InheritedDispatched when the object's tabEnabled flag changes.InteractiveObject
 InheritedDispatched when the value of the object's tabIndex property changes.InteractiveObject
 InheritedDispatched when a user enters one or more characters of text.InteractiveObject
  Signals that an uncaught JavaScript exception occurred in the HTMLLoader object.HTMLLoader
Property Detail
AIR-only 

authenticate

property
authenticate:Boolean

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

Specifies whether authentication requests should be handled (true) or not (false) for HTTP requests issued by this object. If false, authentication challenges return an HTTP error.

The default value is initialized from URLRequestDefaults.authenticate.



Implementation
    public function get authenticate():Boolean
    public function set authenticate(value:Boolean):void

See also

AIR-only 

cacheResponse

property 
cacheResponse:Boolean

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

Specifies whether successful response data should be cached for HTTP requests issued by this object. When set to true, the HTMLLoader object uses the operating system's HTTP cache.

The default value is initialized from URLRequestDefaults.cacheResponse.



Implementation
    public function get cacheResponse():Boolean
    public function set cacheResponse(value:Boolean):void

See also

AIR-only 

contentHeight

property 
contentHeight:Number  [read-only]

Runtime Versions: AIR 1.0

The height, in pixels, of the HTML content. This property can change as the dimensions of the HTMLLoader object change. For example, an HTML page often uses the entire height of the HTMLLoader object, and the contentHeight property may change if you change the height of the HTMLLoader object.



Implementation
    public function get contentHeight():Number
AIR-only 

contentWidth

property 
contentWidth:Number  [read-only]

Runtime Versions: AIR 1.0

The width, in pixels, of the HTML content. This property can change as the dimensions of the HTMLLoader object change. For example, an HTML page often uses the entire width of the HTMLLoader object, and the contentWidth property may change if you change the width of the HTMLLoader object.



Implementation
    public function get contentWidth():Number
AIR-only 

hasFocusableContent

property 
hasFocusableContent:Boolean  [read-only]

Runtime Versions: AIR 1.0

Indicates whether any content in the HTMLLoader object is focusable.



Implementation
    public function get hasFocusableContent():Boolean
AIR-only 

height

property 
height:Number[override]

Runtime Versions: AIR 1.0

Specifies the height of the rectangle of the HTML canvas that is being rendered. This is the height of the HTMLLoader display object in pixels. Changing this property causes the HTMLLoader object to re-render the HTML document. htmlBoundsChanged events may dispatched in response to changing this property. When you set the width or height property of an HTMLLoader object, the bounds of the object change but content is not scaled (as would happen with other types of display objects).



Implementation
    override public function get height():Number
    override public function set height(value:Number):void
AIR-only 

historyLength

property 
historyLength:uint  [read-only]

Runtime Versions: AIR 1.0

The overall length of the history list, including back and forward entries. This property has the same value as the window.history.length JavaScript property of the HTML page.



Implementation
    public function get historyLength():uint

See also

AIR-only 

historyPosition

property 
historyPosition:uint

Runtime Versions: AIR 1.0

The current position in the history list. The history list corresponds to the window.history object of the HTML page. Entries less than the current position are the "back" list; entries greater are "forward." Attempts to set position beyond the end set it to the end.



Implementation
    public function get historyPosition():uint
    public function set historyPosition(value:uint):void

See also

AIR-only 

htmlHost

property 
htmlHost:flash.html:HTMLHost

Runtime Versions: AIR 1.0

The HTMLHost object used to handle changes to certain user interface elements, such as the window.document.title property of the HTMLLoader object. To override default behaviors for the HTMLLoader object, create a subclass of the HTMLHost class and override its member functions to handle various user interface changes in the HTML content.



Implementation
    public function get htmlHost():flash.html:HTMLHost
    public function set htmlHost(value:flash.html:HTMLHost):void

See also

AIR-only 

loaded

property 
loaded:Boolean  [read-only]

Runtime Versions: AIR 1.0

Indicates whether the JavaScript load event corresponding to the previous call to the load() or loadString() method has been delivered to the HTML DOM in the HTMLLoader object. This property is true before the complete event is dispatched. It is possible that this property will never become true. This happens in the same cases as when the complete event is never dispatched.



Implementation
    public function get loaded():Boolean
AIR-only 

location

property 
location:String  [read-only]

Runtime Versions: AIR 1.0

The URL for the content loaded in the HTMLLoader object.



Implementation
    public function get location():String
AIR-only 

manageCookies

property 
manageCookies:Boolean

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

Specifies whether the HTTP protocol stack should manage cookies for this object. If true, cookies are added to the request and response cookies are remembered. If false, cookies are not added to the request and response cookies are not remembered.

The default value is initialized from URLRequestDefaults.manageCookies.



Implementation
    public function get manageCookies():Boolean
    public function set manageCookies(value:Boolean):void

See also

AIR-only 

navigateInSystemBrowser

property 
navigateInSystemBrowser:Boolean

Runtime Versions: AIR 1.0

Specifies whether navigation of the root frame of the HTML content (such as when the user clicks a link, when the window.location property is set, or when calling window.open()) results in navigation in the HTMLLoader object (false) or in the default system web browser (true). Set this property to true if you want all navigation to occur in the system web browser (not in the HTMLLoader object).

The default value is false.



Implementation
    public function get navigateInSystemBrowser():Boolean
    public function set navigateInSystemBrowser(value:Boolean):void
AIR-only 

paintsDefaultBackground

property 
paintsDefaultBackground:Boolean

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

Specifies whether the background of the HTMLLoader document is opaque white (true) or not (false). If this property is set to false, the HTMLLoader object uses its display object container as a background for the HTML and it uses the opacity (alpha value) of the display object container as the HTML background. However, if the body element or any other element of the HTML document has an opaque background color (specified by style="background-color:gray", for instance), then that portion of the rendered HTML uses the specified opaque background color.



Implementation
    public function get paintsDefaultBackground():Boolean
    public function set paintsDefaultBackground(value:Boolean):void
AIR-only 

pdfCapability

property 
pdfCapability:int  [read-only]

Runtime Versions: AIR 1.0

The type of PDF support on the user's system, defined as an integer code value. An HTMLLoader object can display PDF content only if this property evaluates to PDFCapability.STATUS_OK. The PDFCapability class defines constants for possible values of the pdfCapability property, as follows:

PDFCapability constantMeaning
STATUS_OKA sufficient version (8.1 or later) of Acrobat or Adobe Reader is detected and PDF content can be loaded in an HTMLLoader object.

Note: On Windows, if Acrobat or Adobe Reader version 7.x or later, is currently running on the user's system, that version is used even if a later version that supports loading PDF loaded in an HTMLLoader object is installed. In this case, if the value of the pdfCapability property is PDFCapability.STATUS_OK, when an AIR application attempts to load PDF content, the older version of Acrobat or Adobe Reader displays an alert (and the AIR runtime displays no error message). If this is a possibile situation for your users, consider instructing them to close Acrobat or Adobe Reader while running your application. Consider displaying these instructions if the PDF content does not load within an acceptable amount of time.

ERROR_INSTALLED_READER_NOT_FOUNDNo version of Acrobat or Adobe Reader is detected. An HTMLLoader object cannot display PDF content.
ERROR_INSTALLED_READER_TOO_OLDAcrobat or Adobe Reader has been detected, but the version is too old. An HTMLLoader object cannot display PDF content.
ERROR_PREFERED_READER_TOO_OLDA sufficient version (8.1 or later) of Acrobat or Adobe Reader is detected, but the the version that is set up to handle PDF content is older than 8.1. An HTMLLoader object cannot display PDF content.



Implementation
    public static function get pdfCapability():int

See also

AIR-only 

placeLoadStringContentInApplicationSandbox

property 
placeLoadStringContentInApplicationSandbox:Boolean

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.5

Specifies whether content loaded via the loadString() method is put in the application sandbox (true) or in a non-application sandbox (false).

When this property is set to false, content loaded via the loadString() method is placed in a non-application sandbox with the following characteristics:

  • It has access to load content from the network (but not from the filesystem).
  • It cannot load data using XMLHttpRequest.
  • The window.location property is set to "about:blank".
  • The content cannot access the window.runtime property (like content in any non-application sandbox).

When this property is set to true, the content loaded via the loadString() method is placed in the application sandbox, with access to the window.runtime property and to all AIR APIs. You should ensure that the data source for a string used in a call to the loadString() method is trusted. Code statements in the HTML string are executed with full application privileges when this property is set to true. You should only set this property to true when you are certain that the string cannot contain harmful code.

In applications compiled with the AIR 1.0 or AIR 1.1 SDKs, content loaded via the loadString() method is placed in the application sandbox.

The default value is false.



Implementation
    public function get placeLoadStringContentInApplicationSandbox():Boolean
    public function set placeLoadStringContentInApplicationSandbox(value:Boolean):void

See also

AIR-only 

runtimeApplicationDomain

property 
runtimeApplicationDomain:ApplicationDomain

Runtime Versions: AIR 1.0

The application domain to use for the window.runtime object in JavaScript in the HTML page.

If null, or if the HTML content is from a different security domain than the SWF content that contains the HTMLLoader object, the page uses a default application domain for its domain.



Implementation
    public function get runtimeApplicationDomain():ApplicationDomain
    public function set runtimeApplicationDomain(value:ApplicationDomain):void

Throws
SecurityError — if the ApplicationDomain object is not from the caller's security domain.

See also

AIR-only 

scrollH

property 
scrollH:Number

Runtime Versions: AIR 1.0

The horizontal scroll position of the HTML content in the HTMLLoader object.



Implementation
    public function get scrollH():Number
    public function set scrollH(value:Number):void
AIR-only 

scrollV

property 
scrollV:Number

Runtime Versions: AIR 1.0

The vertical scroll position of the HTML content in the HTMLLoader object.



Implementation
    public function get scrollV():Number
    public function set scrollV(value:Number):void
AIR-only 

textEncodingFallback

property 
textEncodingFallback:String

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

The character encoding used by the HTMLLoader content if an HTML page does not specify a character encoding. An HTML page specifies a character encoding in a meta tag, as in the following:

<meta http-equiv="content-type" content="text/html" charset="ISO-8859-1">

Values are defined in the IANA list of valid character sets.

If no encoding is specified by the HTML page, by the textEncodingFallback property, or by the textEncodingOverride property, the HTML content uses ISO-8859-1 encoding.



Implementation
    public function get textEncodingFallback():String
    public function set textEncodingFallback(value:String):void

See also

AIR-only 

textEncodingOverride

property 
textEncodingOverride:String

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

The character encoding used by the HTMLLoader content, overriding any setting in the HTML page. An HTML page specifies a character encoding in a meta tag, as in the following:

<meta http-equiv="content-type" content="text/html" charset="ISO-8859-1">

This setting also overrides any setting in the textEncodingFallback property.

Values are defined in the IANA list of valid character sets.

Set the textEncodingOverride property after the HTML content has loaded to have AIR refresh the HTML content using the specified encoding. After the HTMLLoader navigates to a new page, you need to set the property again if you want the new page to use a specific encoding.

If no encoding is specified by the HTML page, by the textEncodingFallback property, or by the textEncodingOverride property, the HTML content uses ISO-8859-1 encoding.

Setting the textEncodingOverride property to null restores the default behavior.



Implementation
    public function get textEncodingOverride():String
    public function set textEncodingOverride(value:String):void

See also

AIR-only 

useCache

property 
useCache:Boolean

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0

Specifies whether the local cache should be consulted before HTTP requests issued by this object fetch data.

The default value is initialized from URLRequestDefaults.useCache.



Implementation
    public function get useCache():Boolean
    public function set useCache(value:Boolean):void

See also

AIR-only 

userAgent

property 
userAgent:String

Runtime Versions: AIR 1.0

The user agent string to be used in any upcoming content requests from this HTMLLoader object.

To set the user agent string, set the userAgent property of the HTMLLoader object before calling the load() method. The userAgent property of the URLRequest object passed to the load() method is not used.

You can set the default user agent string used by all HTMLLoader objects in an application domain by setting the URLRequestDefaults.userAgent property. If no value is set for the userAgent property of the HTMLLoader object (or if the value is set to null), the user agent string is set to the value of the static URLRequestDefaults.userAgent property.

If a value is set for neither the userAgent property of the HTMLLoader nor for URLRequestDefaults.userAgent, a default value is used as the user agent string. This default value varies depending on the runtime operating system (such as Mac OS, Linux, or Windows), the runtime language, and the runtime version, as in the following examples:

  • "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/526.9+ (KHTML, like Gecko) AdobeAIR/1.5"
  • "Mozilla/5.0 (Windows; U; en) AppleWebKit/526.9+ (KHTML, like Gecko) AdobeAIR/1.5"
  • "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/526.9+ (KHTML, like Gecko) AdobeAIR/1.5"



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

See also

AIR-only 

width

property 
width:Number[override]

Runtime Versions: AIR 1.0

Specifies the width of the rectangle of the HTML canvas that is being rendered. This is the width of the HTMLLoader display object in pixels. Changing this property causes the HTMLLoader object to re-render the HTML document. htmlBoundsChange events may dispatched in response to changing this property. When you set the width and height properties of an HTMLLoader object, the bounds of the object change but content is not scaled (as would happen with other types of display objects).



Implementation
    override public function get width():Number
    override public function set width(value:Number):void
AIR-only 

window

property 
window:Object  [read-only]

Runtime Versions: AIR 1.0

The global JavaScript object for the content loaded into the HTML control.



Implementation
    public function get window():Object
Constructor Detail
AIR-only 

HTMLLoader

()Constructor
public function HTMLLoader()

Runtime Versions: AIR 1.0

Creates an HTMLLoader object.

Method Detail

AIR-only cancelLoad

()method
public function cancelLoad():void

Runtime Versions: AIR 1.0

Cancels any load operation in progress.

AIR-only createRootWindow

()method 
public static function createRootWindow(visible:Boolean = true, windowInitOptions:NativeWindowInitOptions = null, scrollBarsVisible:Boolean = true, bounds:Rectangle = null):flash.html:HTMLLoader

Runtime Versions: AIR 1.0

Creates a new NativeWindow object that contains an HTMLLoader object. Use the HTMLLoader object that is returned by this method to load HTML content.

By default (when you set no parameters in calling this method), the new window uses standard system chrome and includes scrollbar controls for the content. You can set the parameters to change the properties of the new window.

Parameters

visible:Boolean (default = true) — Specifies whether the window is visible.
 
windowInitOptions:NativeWindowInitOptions (default = null) — Specifies window initialization options; if null, uses default NativeWindowInitOptions values.
 
scrollBarsVisible:Boolean (default = true) — Specifies whether the window provides scrollbars.
 
bounds:Rectangle (default = null) — If not null, specifies the window bounds. If any of x, y, width, or height is NaN, then the corresponding dimension of the window is left at its default value.

Returns
flash.html:HTMLLoader — A new HTMLLoader object that is on the stage of the new NativeWindow object.

AIR-only getHistoryAt

()method 
public function getHistoryAt(position:uint):flash.html:HTMLHistoryItem

Runtime Versions: AIR 1.0

Returns the history entry at the specified position.

Parameters

position:uint — The position in the history list.

Returns
flash.html:HTMLHistoryItem — A URLRequest object for the history entry at the specified position.

See also

AIR-only historyBack

()method 
public function historyBack():void

Runtime Versions: AIR 1.0

Navigates back in the browser history, if possible.

Calling this method of the HTMLLoader object has the same effect as calling the back() method of the window.history property in JavaScript in the HTML page.

This function throws no errors.

See also

AIR-only historyForward

()method 
public function historyForward():void

Runtime Versions: AIR 1.0

Navigates forward in the browser history, if possible.

Calling this method of the HTMLLoader object has the same effect as calling the forward() method of the window.history property in JavaScript in the HTML page.

This function throws no errors.

See also

AIR-only historyGo

()method 
public function historyGo(steps:int):void

Runtime Versions: AIR 1.0

Navigates the specified number of steps in the browser history. Navigates forward if positive, backward if negative. Navigation by zero forces a reload.

This method is equivalent to calling the go() method of the window.history property in JavaScript in the HTML page.

This function throws no errors.

Parameters

steps:int — The number of steps in the history list to move forward (positive) or backward (negative).

See also

AIR-only load

()method 
public function load(urlRequestToLoad:URLRequest):void

Runtime Versions: AIR 1.0

Loads the HTMLLoader object with data from the site specified by the urlRequestToLoad parameter. Calling this method initially sets the loaded property to false. This method initiates an operation that always completes asynchronously.

A call to this method implicitly cancels any pending previous load operation initiated with this method or with the loadString() method. The complete event for the previous load operation will never be delivered.

It is possible that the complete event will never be delivered. This happens if any of the HTML content loaded into the HTMLLoader object never downloads completely. This can happen if the HTML content references a URL to a CGI script that repetedly generates content indefinitely.

Parameters

urlRequestToLoad:URLRequest — The URLRequest object containing information about the URL to load. In addition to the URL to load, a URLRequest object contains properties that define the HTTP form submission method (GET or POST), any data to be transmitted with the request, and request headers.

See also

AIR-only loadString

()method 
public function loadString(htmlContent:String):void

Runtime Versions: AIR 1.0

Loads the HTMLLoader object with the HTML content contained in the HTML string. When rendering of the of the HTML in the string is complete, the complete event is dispatched. The complete event is always dispatched asynchronously.

A call to this method implicitly cancels any pending previous load operation initiated with this method or with the load() method. The complete event for the previous load operation will never be delivered.

If the HTML specified in the string has no references to external resources, then this method synchronously renders the HTML. However, the complete event is still dispatched asynchronously. If the loaded property of this class is true immediately following a call to this function, the HTML content specified in the htmlContent argument was rendered synchronously.

It is possible that the complete event will never be delivered. This happens if any of the HTML content loaded into the HTMLLoader object never downloads completely. This can happen if the HTML content references a URL to a CGI script that repetedly generates content indefinitely.

Content loaded via the loadString() method is put in the application security sandbox only if the placeLoadStringContentInApplicationSandbox property is set to true.

Parameters

htmlContent:String — The string containing the HTML content to load into the HTMLLoader object.

See also

AIR-only reload

()method 
public function reload():void

Runtime Versions: AIR 1.0

Reloads the page from the current location.

Event Detail
AIR-only 

complete

Event
Event Object Type: flash.events.Event
property Event.type = flash.events.Event.COMPLETE

Runtime Versions: AIR 1.0

Signals that the last load operation requested by loadString or load method has completed. The event is dispatched after the JavaScript load event has fired on the HTML DOM in the HTMLLoader object. This event is always dispatched asynchronously. The event handler for this event can call any method or access any property of the HTMLLoader object.

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

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe network object that has completed loading.

See also

AIR-only 

htmlBoundsChange

Event  
Event Object Type: flash.events.Event
property Event.type = flash.events.Event.HTML_BOUNDS_CHANGE

Runtime Versions: AIR 1.0

Signals that one or both of the contentWidth and contentHeight properties of the HTMLLoader object has changed. This may be result from a new image or other content loading, for example. Event handlers may call any method or access any property of the HTMLLoader object.

The HTMLLoader object can dispatch this event any time after a load operation is initiated, even after the object has dispatched the complete event.

The Event.HTML_BOUNDS_CHANGE constant defines the value of the type property of an htmlBoundsChange event object.

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe HTMLLoader object.
targetThe HTMLLoader object.

See also

AIR-only 

htmlDOMInitialize

Event  
Event Object Type: flash.events.Event
property Event.type = flash.events.Event.HTML_DOM_INITIALIZE

Runtime Versions: AIR 1.0

Signals that the HTML DOM has been created in response to a load operation. The load() and loadString() methods of the HTMLLoader object throw an exception while this event is being dispatched. Any property or method of any JavaScript object accessible from the window property of the HTMLLoader object that controls the URL that is loaded in the HTMLLoader object throws an exception if set or called while this event is dispatched. For example, setting window.location by setting the window property of the HTMLLoader object results in a JavaScript exception.

The Event.HTML_DOM_INITIALIZE constant defines the value of the type property of an htmlDOMInitialize event object.

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe HTMLLoader object.
targetThe HTMLLoader object.

See also

AIR-only 

htmlRender

Event  
Event Object Type: flash.events.Event
property Event.type = flash.events.Event.HTML_RENDER

Runtime Versions: AIR 1.0

Signals that the rendering of content in the HTMLLoader object is fully up to date. This event can be dispatched quite frequently—whenever any rendering change is made to the HTML content. For example, this event is dispatched when new content is displayed as a result of a user clicking a link or when JavaScript in the page renders HTML. Event listeners can call any method or access any property of the HTMLLoader object.

Handlers of this event should check the contentWidth and contentHeight properties of the HTMLLoader object to update any scroll bars associated with it.

The HTMLLoader object can dispatch this event any time after a load operation is initiated, even after the object has dispatched the complete event.

The Event.HTML_RENDER constant defines the value of the type property of an htmlRender event object.

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe HTMLLoader object.
targetThe HTMLLoader object.
AIR-only 

locationChange

Event  
Event Object Type: flash.events.Event
property Event.type = flash.events.Event.LOCATION_CHANGE

Runtime Versions: AIR 1.0

Signals that the location property of the HTMLLoader object has changed. The event handler for this event can call any method or access any property of the HTMLLoader object.

The Event.LOCATION_CHANGE constant defines the value of the type property of a locationChange event object.

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe HTMLLoader object.
targetThe HTMLLoader object.

See also

AIR-only 

scroll

Event  
Event Object Type: flash.events.Event
property Event.type = flash.events.Event.SCROLL

Runtime Versions: AIR 1.0

Signals that the scrollH or scrollV property has been changed by the HTMLLoader object. The HTMLLoader object dispatches this event when JavaScript running in the HTMLLoader object invokes the scrollTo() method of the window object and the desired location is not already visible. The event is not dispatched when ActionScript code changes the scrollH or scrollV property. Event handlers may call any method or access any property of the HTMLLoader object.

Event handlers for this event should check the scrollH and scrollV properties to update any scroll bars associated with the HTMLLoader object.

The HTMLLoader object can dispatch this event any time after a load operation is initiated, even after the object has dispatched the complete event.

The Event.SCROLL constant defines the value of the type property of a scroll event object.

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe TextField object that has been scrolled. The target property is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event.
AIR-only 

uncaughtScriptException

Event  
Event Object Type: flash.events.HTMLUncaughtScriptExceptionEvent
property HTMLUncaughtScriptExceptionEvent.type = flash.events.HTMLUncaughtScriptExceptionEvent.UNCAUGHT_SCRIPT_EXCEPTION

Runtime Versions: AIR 1.0

Signals that an uncaught JavaScript exception occurred in the HTMLLoader object. Event handlers can call any method or access any property of the HTMLLoader object. The event is cancelable, and the default behavior when running in the AIR Debug Launcher is to send the JavaScript stack to the trace output.

The HTMLUncaughtScriptExceptionEvent.UNCAUGHT_SCRIPT_EXCEPTION constant defines the value of the type property of an uncaughtScriptException event object.

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
exceptionValueThe result of evaluating the expression in the throw statement that resulted in the uncaught exception.
stackTraceAn array of objects that represent the stack trace at the time the throw statement that resulted in the uncaught exception was executed.
targetThe HTMLLoader object.

See also

HTMLLoader.1.as

The following code initializes an HTMLLoader object, configures its width and height, loads the URL http://www.adobe.com, and adds the object to the display list:
package {
    import flash.display.Sprite;
    import flash.html.HTMLLoader;
    import flash.net.URLRequest;

    public class HTMLLoaderExample extends Sprite
    {
        public function HTMLLoaderExample()
        {
            var html:HTMLLoader = new HTMLLoader();
            var urlReq:URLRequest = new URLRequest("http://www.adobe.com/");
            html.width = stage.stageWidth;
            html.height = stage.stageHeight;
            html.load(urlReq); 
            addChild(html);
        }
    }
}