(AIR only)
Packageflash.html
Classpublic class HTMLLoader
InheritanceHTMLLoader Inheritance Sprite Inheritance DisplayObjectContainer Inheritance InteractiveObject Inheritance DisplayObject Inheritance EventDispatcher Inheritance Object

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 limit of the width or height of an HTMLLoader is 2880. Setting width or height of an HTMLLoader object to a number greater than 2880 results in an ArgumentError exception being thrown.

View the examples



Public Properties
 PropertyDefined By
 InheritedaccessibilityProperties : AccessibilityProperties
The current accessibility options for this display object.
DisplayObject
 Inheritedalpha : Number
Indicates the alpha transparency value of the object specified.
DisplayObject
  AIR-onlyauthenticate : 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
 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-onlycacheResponse : 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-onlycontentHeight : Number
[read-only] The height, in pixels, of the HTML content.
HTMLLoader
  AIR-onlycontentWidth : 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-onlyhasFocusableContent : Boolean
[read-only] Indicates whether any content in the HTMLLoader object is focusable.
HTMLLoader
  AIR-onlyheight : Number
Specifies the height of the rectangle of the HTML canvas that is being rendered.
HTMLLoader
  AIR-onlyhistoryLength : uint
[read-only] The overall length of the history list, including back and forward entries.
HTMLLoader
  AIR-onlyhistoryPosition : 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-onlyhtmlHost : 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-onlyloaded : 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-onlylocation : String
[read-only] The URL for the content loaded in the HTMLLoader object.
HTMLLoader
  AIR-onlymanageCookies : 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-onlynavigateInSystemBrowser : 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-onlypaintsDefaultBackground : 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-onlypdfCapability : int
[static] [read-only] The type of PDF support on the user's system, defined as an integer code value.
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
  AIR-onlyruntimeApplicationDomain : 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
  AIR-onlyscrollH : Number
The horizonal scroll position of the HTML content in the HTMLLoader object.
HTMLLoader
 InheritedscrollRect : Rectangle
The scroll rectangle bounds of the display object.
DisplayObject
  AIR-onlyscrollV : Number
The vertical scroll position of the HTML content in the HTMLLoader object.
HTMLLoader
 InheritedsoundTransform : 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-onlytextEncodingFallback : String
The character encoding used by the HTMLLoader content if an HTML page does not specify a character encoding.
HTMLLoader
  AIR-onlytextEncodingOverride : String
The character encoding used by the HTMLLoader content, overriding any setting in the HTML page.
HTMLLoader
 InheritedtextSnapshot : TextSnapshot
[read-only] Returns a TextSnapshot object for this DisplayObjectContainer instance.
DisplayObjectContainer
 Inheritedtransform : Transform
An object with properties pertaining to a display object's matrix, color transform, and pixel bounds.
DisplayObject
  AIR-onlyuseCache : 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-onlyuserAgent : 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-onlywidth : Number
Specifies the width of the rectangle of the HTML canvas that is being rendered.
HTMLLoader
  AIR-onlywindow : 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
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-onlycreateRootWindow(visible:Boolean = true, windowInitOptions:NativeWindowInitOptions = null, scrollBarsVisible:Boolean = true, bounds:Rectangle = null):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
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-onlyhistoryGo(steps:int):void
Navigates the specified number of steps in the browser history.
HTMLLoader
 Inherited
Evaluates the display object to see if it overlaps or intersects with 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-onlyload(urlRequestToLoad:URLRequest):void
Loads the HTMLLoader object with data from the site specified by the urlRequestToLoad parameter.
HTMLLoader
  
AIR-onlyloadString(htmlContent:String):void
Loads the HTMLLoader object with the HTML content contained in the HTML string.
HTMLLoader
 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
  
AIR-onlyreload():void
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 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 Dispatched when Flash Player or an AIR application gains operating system focus and becomes active.EventDispatcher
 Inherited Dispatched when a display object is added to the display list.DisplayObject
 Inherited Dispatched 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
 Inherited Dispatched 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
 Inherited Dispatched when the user selects the context menu associated with this interactive object in an AIR application.InteractiveObject
 Inherited Dispatched when Flash Player or an AIR application loses operating system focus and is becoming inactive.EventDispatcher
 Inherited Dispatched 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 Dispatched when the playhead is entering a new frame.DisplayObject
 Inherited Dispatched after a display object gains focus.InteractiveObject
 Inherited Dispatched after a display object loses focus.InteractiveObject
   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
 Inherited Dispatched when the user presses a key.InteractiveObject
 Inherited Dispatched when the user attempts to change focus by using keyboard navigation.InteractiveObject
 Inherited Dispatched when the user releases a key.InteractiveObject
   Signals that the location property of the HTMLLoader object has changed.HTMLLoader
 Inherited Dispatched when a user presses and releases the middle button of the user's pointing device over the same InteractiveObject.InteractiveObject
 Inherited Dispatched when a user presses the middle pointing device button over an InteractiveObject instance.InteractiveObject
 Inherited Dispatched when a user releases the pointing device button over an InteractiveObject instance.InteractiveObject
 Inherited Dispatched when a user presses the pointing device button over an InteractiveObject instance.InteractiveObject
 Inherited Dispatched when the user attempts to change focus by using a pointer device.InteractiveObject
 Inherited Dispatched when a user moves the pointing device while it is over an InteractiveObject.InteractiveObject
 Inherited Dispatched when the user moves a pointing device away from an InteractiveObject instance.InteractiveObject
 Inherited Dispatched when the user moves a pointing device over an InteractiveObject instance.InteractiveObject
 Inherited Dispatched when a user releases the pointing device button over an InteractiveObject instance.InteractiveObject
 Inherited Dispatched when a mouse wheel is spun over an InteractiveObject instance.InteractiveObject
 Inherited Dispatched by the drag initiator InteractiveObject when the user releases the drag gesture.InteractiveObject
 Inherited Dispatched 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
 Inherited Dispatched by an InteractiveObject when a drag gesture enters its boundary.InteractiveObject
 Inherited Dispatched by an InteractiveObject when a drag gesture leaves its boundary.InteractiveObject
 Inherited Dispatched by an InteractiveObject continually while a drag gesture remains within its boundary.InteractiveObject
 Inherited Dispatched at the beginning of a drag operation by the InteractiveObject that is specified as the drag initiator in the DragManager.doDrag() call.InteractiveObject
 Inherited Dispatched during a drag operation by the InteractiveObject that is specified as the drag initiator in the DragManager.doDrag() call.InteractiveObject
 Inherited Dispatched when a display object is about to be removed from the display list.DisplayObject
 Inherited Dispatched 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 Dispatched when the display list is about to be updated and rendered.DisplayObject
 Inherited Dispatched when a user presses and releases the right button of the user's pointing device over the same InteractiveObject.InteractiveObject
 Inherited Dispatched when a user presses the pointing device button over an InteractiveObject instance.InteractiveObject
 Inherited Dispatched when a user releases the pointing device button over an InteractiveObject instance.InteractiveObject
 Inherited Dispatched when the user moves a pointing device away from an InteractiveObject instance.InteractiveObject
 Inherited Dispatched when the user moves a pointing device over an InteractiveObject instance.InteractiveObject
  
AIR-onlyscroll
Signals that the scrollH or scrollV property has been changed by the HTMLLoader object.HTMLLoader
 Inherited Dispatched when the value of the object's tabChildren flag changes.InteractiveObject
 Inherited Dispatched when the object's tabEnabled flag changes.InteractiveObject
 Inherited Dispatched when the value of the object's tabIndex property changes.InteractiveObject
   Signals that an uncaught JavaScript exception occurred in the HTMLLoader object.HTMLLoader
Property Detail
AIR-only authenticateproperty
authenticate:Boolean  [read-write]

Language Version : ActionScript 3.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 cacheResponseproperty 
cacheResponse:Boolean  [read-write]

Language Version : ActionScript 3.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 contentHeightproperty 
contentHeight:Number  [read-only]

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 contentWidthproperty 
contentWidth:Number  [read-only]

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 hasFocusableContentproperty 
hasFocusableContent:Boolean  [read-only]

Indicates whether any content in the HTMLLoader object is focusable.


Implementation
    public function get hasFocusableContent():Boolean
AIR-only heightproperty 
height:Number  [read-write]

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
    public function get height():Number
    public function set height(value:Number):void
AIR-only historyLengthproperty 
historyLength:uint  [read-only]

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 the HTML page.


Implementation
    public function get historyLength():uint

See also

AIR-only historyPositionproperty 
historyPosition:uint  [read-write]

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 htmlHostproperty 
htmlHost:HTMLHost  [read-write]

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():HTMLHost
    public function set htmlHost(value:HTMLHost):void

See also

AIR-only loadedproperty 
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. 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.