flash.htmlHTMLSWFCapability The HTMLSWFCapability class contains possible values of the swfCapability property of an HTMLLoader object.Object The HTMLSWFCapability class contains possible values of the swfCapability property of an HTMLLoader object. It also defines the values of the errorID property of an ErrorEvent object dispatched when an attempt to load SWF content is unsuccessful. HTMLLoader.swfCapabilityERROR_INSTALLED_PLAYER_NOT_FOUND No version of Adobe Flash Player is detected.3221int No version of Adobe Flash Player is detected. An HTMLLoader object cannot display PDF content. ERROR_INSTALLED_PLAYER_TOO_OLD Adobe Flash Player is detected, but the version is too old.3222int Adobe Flash Player is detected, but the version is too old. An HTMLLoader object cannot display SWF content. STATUS_OK A sufficient version of Adobe Flash Player is detected and SWF content can be loaded in a HTMLLoader object.0int A sufficient version of Adobe Flash Player is detected and SWF content can be loaded in a HTMLLoader object. HTMLHistoryItem An HTMLHistoryItem object describes a location in the navigation history of an HTMLLoader object.Object An HTMLHistoryItem object describes a location in the navigation history of an HTMLLoader object. HTMLLoaderHTMLWindowCreateOptionsisPost Indicates whether the HTML page includes POST data.Boolean Indicates whether the HTML page includes POST data. originalUrl The original URL of the HTML page, before any redirects.String The original URL of the HTML page, before any redirects. title The title of the HTML page.String The title of the HTML page. url The URL of the HTML page.String The URL of the HTML page. HTMLHost An HTMLHost object defines behaviors of an HTMLLoader object for user interface elements that can be controlled by setting various properties or by calling various methods of the window object of the HTML page.Object An HTMLHost object defines behaviors of an HTMLLoader object for user interface elements that can be controlled by setting various properties or by calling various methods of the window object of the HTML page. These methods and properties are:
  • window.blur()
  • window.focus()
  • window.moveBy()
  • window.moveTo()
  • window.location
  • window.close()
  • window.open()
  • window.resizeBy()
  • window.resizeTo()
  • window.status
  • window.document.title

The methods in the HTMLHost class provide ways of handling changes in each of these window settings. To use this class, create a new class (a subclass) that extends the HTMLHost class and that overrides the methods for which you want to define behaviors. The methods of the HTMLHost class handle JavaScript properties and methods as follows:

JavaScript property or methodHTMLHost methodwindow.blur()windowBlur()window.focus()windowFocuswindow.locationupdateLocationwindow.close()windowClosewindow.open()createWindowwindow.statusupdateStatuswindow.document.titleupdateTitle

To respond to changes in the window.moveBy(), window.moveTo(), window.resizeBy(), and window.resizeTo() methods, override the set windowRect() method in the subclass of HTMLHost.

Each HTMLHost object can be associated with at most one HTMLLoader object. Assigning an HTMLHost instance to the htmlHost property of the HTMLLoader object establishes this relationship. Assigning null to the htmlHost property of the HTMLLoader object or setting the HTMLHost object as the htmlHost property of another HTMLLoader object removes the HTMLHost from the first HTMLLoader object.

The following code defines CustomHost, a subclass of HTMLHost. Methods of the CustomHost class override the inherited methods in the HTMLHost class to define actions taken when JavaScript code in the HTMLLoader page sets various properties or calls various methods of the window object: package { import flash.html.HTMLHost; import flash.html.HTMLLoader; import flash.display.NativeWindow; import flash.display.NativeWindowInitOptions; import flash.display.StageScaleMode; import flash.geom.Rectangle; import flash.text.TextField; public class CustomHost extends HTMLHost { import flash.html.*; public var statusField:TextField; public function CustomHost(defaultBehaviors:Boolean=true) { super(defaultBehaviors); } override public function windowClose():void { htmlLoader.stage.window.close(); } override public function createWindow(windowCreateOptions:HTMLWindowCreateOptions):HTMLLoader { var initOptions:NativeWindowInitOptions = new NativeWindowInitOptions(); var window:NativeWindow = new NativeWindow(initOptions); window.visible = true; var htmlLoader2:HTMLLoader = new HTMLLoader(); htmlLoader2.width = window.width; htmlLoader2.height = window.height; window.stage.scaleMode = StageScaleMode.NO_SCALE; window.stage.addChild(htmlLoader2); return htmlLoader2; } override public function updateLocation(locationURL:String):void { trace(locationURL); } override public function set windowRect(value:Rectangle):void { htmlLoader.stage.nativeWindow.bounds = value; } override public function updateStatus(status:String):void { statusField.text = status; } override public function updateTitle(title:String):void { htmlLoader.stage.nativeWindow.title = title + "- Example Application"; } override public function windowBlur():void { htmlLoader.alpha = 0.5; } override public function windowFocus():void { htmlLoader.alpha = 1; } } } Create the following class, which adds an HTMLLoader object to the stage, as well as a TextField object named statusBar. The HTMLLoader object defines a CustomHost object as its htmlHost property: package { import flash.display.Sprite; public class SimpleHTMLBox extends Sprite { import flash.html.HTMLHost; import flash.html.HTMLLoader; import flash.text.TextField; import flash.net.URLRequest; import CustomHost; private var host:CustomHost; private var statusField:TextField; private var html:HTMLLoader; public function SimpleHTMLBox() { html = new HTMLLoader(); var url:String = "Test.html"; var urlReq:URLRequest = new URLRequest(url); html.load(urlReq); host = new CustomHost(); html.htmlHost = host; statusField = new TextField(); host.statusField = statusField; configureUI(); } private function configureUI():void { html.width = 400; html.height = 200; statusField.width = 400; statusField.height = 24; statusField.border = true; statusField.y = 200; addChild(html); addChild(statusField); } } }

Build an AIR application that adds an object defined by this class to the main window's stage.

Create an HTML page named Test.html in the application resources directory (the directory that contains the application descriptor file), and add the following content to it:

<html> <head> <title>Test</title> </head> <body> <a href="#" onclick="window.open('Test.html')">window.open('Test.html')</a> <br/><a href="#" onclick="window.document.location = 'www.adobe.com'">window.document.location = 'www.adobe.com'</a> <br/><a href="#" onclick="window.moveBy(6, 12)">moveBy(6, 12)</a> <br/><a href="#" onclick="window.close()">window.close()</a> <br/><a href="#" onclick="window.blur()">window.blur()</a> <br/><a href="#" onclick="window.focus()">window.focus()</a> <br/><a href="#" onclick="window.status = new Date().toString()">window.status = new Date().toString()</a> </body> </html>

When you test the application, the CustomHost class handles the user-interface-related JavaScript settings in the HTML page.

HTMLLoaderHTMLWindowCreateOptionsHTMLHost Creates an HTMLHost object.defaultBehaviorsBooleantrueIndicates wether root-content behaviors should be provided by default. Creates an HTMLHost object. createWindow The function called when JavaScript code in the HTMLLoader object calls the window.open() method.An HTMLLoader object that contains the new HTML page. Typically, you create a new HTMLLoader object in this method, add it to the stage of a new NativeWindow object, and then return it. flash.html:HTMLLoaderwindowCreateOptionsflash.html:HTMLWindowCreateOptionsAn object containing properties in the string passed as the features parameter of the call to window.open(). The function called when JavaScript code in the HTMLLoader object calls the window.open() method.

By default, a JavaScript call to window.open() in the HTML page of an HTMLLoader does not open an new NativeWindow object in the runtime. You can open a new NativeWindow object in the runtime by creating a new NativeWindow object in the createWindow method override in the subclass of the HTMLHost class.

updateLocation The function called when JavaScript code in the HTMLLoader object sets the window.location property.locationURLStringThe value to which the location property of the window property of the HTMLLoader object is set. The function called when JavaScript code in the HTMLLoader object sets the window.location property. updateStatus The function called when JavaScript code in the HTMLLoader object sets the window.status property.statusStringThe value to which the status property of the window property of the HTMLLoader object is set. The function called when JavaScript code in the HTMLLoader object sets the window.status property. updateTitle The function called when JavaScript code in the HTMLLoader object sets the window.document.title property or when the title element changes, either via the DOM or because of a new page load.titleStringThe value to which the window.document.title property of the HTMLLoader object is set. The function called when JavaScript code in the HTMLLoader object sets the window.document.title property or when the title element changes, either via the DOM or because of a new page load. windowBlur The function called when JavaScript code in the HTMLLoader object calls the window.blur() method. The function called when JavaScript code in the HTMLLoader object calls the window.blur() method. windowClose The function called when JavaScript code in the HTMLLoader object calls the window.close() method. The function called when JavaScript code in the HTMLLoader object calls the window.close() method.

By default, a JavaScript call to window.close() in the HTML page of an HTMLLoader object closes the windows containing the HTMLLoader object.

windowFocus The function called when JavaScript code in the HTMLLoader object calls the window.focus() method. The function called when JavaScript code in the HTMLLoader object calls the window.focus() method. htmlLoader The HTMLLoader object to which this HostControl object applies.flash.html:HTMLLoader The HTMLLoader object to which this HostControl object applies. The htmlHost property of that HTMLLoader object is set to this HostControl object. HTMLLoader.htmlHostwindowRect The property that is changed when JavaScript code in the HTMLLoader object calls the window.moveBy(), window.moveTo(), window.resizeBy(), or window.resizeTo() method.flash.geom:Rectangle The property that is changed when JavaScript code in the HTMLLoader object calls the window.moveBy(), window.moveTo(), window.resizeBy(), or window.resizeTo() method.

In the subclass of HTMLHost, override the set windowRect() method to handle the new window bounds, as desired.

HTMLPDFCapability The HTMLPDFCapability class contains possible values of the pdfCapability property of an HTMLLoader object.Object The HTMLPDFCapability class contains possible values of the pdfCapability property of an HTMLLoader object. It also defines the values of the errorID property of an ErrorEvent object dispatched when an attempt to load PDF content is unsuccessful. HTMLLoader.pdfCapabilityERROR_CANNOT_LOAD_READER An error was returned by the OS when trying to load the Adobe Reader or Acrobat application or one of its necessary libraries.3204int An error was returned by the OS when trying to load the Adobe Reader or Acrobat application or one of its necessary libraries.

Note: This is not returned from HTMLLoader.pdfCapability, but it is sent as the errorID property of an ErrorEvent object dispatched when an HTMLLoader object attempts to load PDF content and the operating system returns an error. HTMLLoader.pdfCapability may return PDFCapability.STATUS_OK, because it examines only the configuration and does not attempt to load any libraries.

ERROR_INSTALLED_READER_NOT_FOUND No version of Adobe Reader is detected.3201int No version of Adobe Reader is detected. An HTMLLoader object cannot display PDF content. ERROR_INSTALLED_READER_TOO_OLD Adobe Reader is detected, but the version is too old.3202int Adobe Reader is detected, but the version is too old. An HTMLLoader object cannot display PDF content. ERROR_PREFERRED_READER_TOO_OLD A sufficient version (8.1 or later) of Adobe Reader or Acrobat is detected, but the the version of Adobe Reader that is set up to handle PDF content is older than Adobe Reader or Acrobat 8.1.3203int A sufficient version (8.1 or later) of Adobe Reader or Acrobat is detected, but the the version of Adobe Reader that is set up to handle PDF content is older than Adobe Reader or Acrobat 8.1. An HTMLLoader object cannot display PDF content.
HTMLLoader The HTMLLoader class defines a type of display object that is a container for HTML content.flash.display:Sprite The HTMLLoader class defines a type of display object that is a container for HTML content.

AIR profile support: This feature is supported on all desktop operating systems, but is not supported on mobile devices or on AIR for TV devices. You can test for support at run time using the HTMLLoader.isSupported property. See AIR Profile Support for more information regarding API support across multiple profiles.

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 4,096 pixels in height and 4,096 pixels in width. Setting width or height of an HTMLLoader object to a number that exceeds 4,095 causes the HTMLLoader object to throw an ArgumentError exception. (Note, prior to AIR 2, the maximum size of HTMLLoader object was 2,880 pixels.)

Note: When displayed in a transparent window, SWF content embedded in an HTML page must be embedded using either the transparent or opaque wmode. The default value for wmode is window, so if you do not specify a value, SWF content may not be displayed. On Windows and Linux, SWF content always appears on top of other content when wmode is set to window or opaque. PDF content cannot be displayed in a transparent window no matter which wmode setting is used.

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); } } }
htmlDOMInitialize Signals that the HTML DOM has been created in response to a load operation.flash.events.Event.HTML_DOM_INITIALIZEflash.events.Event 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. loadString()load()uncaughtScriptException Signals that an uncaught JavaScript exception occurred in the HTMLLoader object.flash.events.HTMLUncaughtScriptExceptionEvent.UNCAUGHT_SCRIPT_EXCEPTIONflash.events.HTMLUncaughtScriptExceptionEvent 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. loadString()load()scroll Signals that the scrollH or scrollV property has been changed by the HTMLLoader object.flash.events.Event.SCROLLflash.events.Event 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.

htmlBoundsChange Signals that one or both of the contentWidth and contentHeight properties of the HTMLLoader object has changed.flash.events.Event.HTML_BOUNDS_CHANGEflash.events.Event 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.

contentWidthcontentHeight
locationChange Signals that the location property of the HTMLLoader object has changed.flash.events.LocationChangeEvent.LOCATION_CHANGEflash.events.LocationChangeEventSignals that the location property of the HTMLLoader object has changed. 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.

A locationChange event of type LocationChangeEvent is dispatched by the HTMLLoader in applications using AIR namespace 2.7 and later. In earlier versions of AIR, the dispatched event object is an instance of the Event class.

loadString()load()
locationChange Signals that the location property of the HTMLLoader object has changed.flash.events.Event.LOCATION_CHANGEflash.events.EventSignals that the location property of the HTMLLoader object has changed. 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.

A locationChange event of type Event is dispatched by the HTMLLoader in applications using an AIR namespace prior to 2.7. In AIR 2.7 and later, the event object is an instance of the LocationChangeEvent class, which provides an additional location property set to the new page URL.

loadString()load()
locationChanging Signals that the location property of the HTMLLoader object is about to change.flash.events.LocationChangeEvent.LOCATION_CHANGINGflash.events.LocationChangeEventSignals that the location property of the HTMLLoader object is about to change. Signals that the location property of the HTMLLoader object is about to change.

A locationChanging event is dispatched only when the location change is initiated through user interaction, such as when a user clicks a link, or by code running inside the HTMLLoader, such as a client-side redirect. By default, the new location is displayed in this HTMLLoader object. You can call the preventDefault() method of the event object to cancel the default behavior. For example, you could use the flash.net.navigateToURL() function to open the page in the system browser based on the location property of the event object.

A locationChanging() event is not dispatched when you call the following methods:

  • load()
  • loadString()
  • reload()
  • historyBack()
  • historyForward()
  • historyGo()

In addition, this event is not dispatched when the navigateInSystemBrowser property is true and the destination page is opened in the system browser, since the HTMLLoader location does not change.

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. If the user (or JavaScript on the page) attempts to navigate to a URL that doesn't start with the base URL, the navigation is prevented: package{ import flash.display.Sprite; import flash.html.HTMLLoader; import flash.net.URLRequest; public class LocationChanging extends Sprite { var htmlLoader:HTMLLoader = new HTMLLoader(); public function LocationChanging() { htmlLoader.width = stage.stageWidth; htmlLoader.height = stage.stageHeight; htmlLoader.addEventListener( LocationChangeEvent.LOCATION_CHANGING, onLocationChanging ); htmlLoader.load( new URLRequest( "http://www.adobe.com" ) ); this.addChild( htmlLoader ); } private function onLocationChanging( event:LocationChangeEvent ):void { trace( "Location changing: " + event.location ); if ( event.location.indexOf( "http://www.adobe.com" ) < 0 ) { event.preventDefault(); } } } }
htmlRender Signals that the rendering of content in the HTMLLoader object is fully up to date.flash.events.Event.HTML_RENDERflash.events.Event 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.

complete Signals that the last load operation requested by loadString or load method has completed.flash.events.Event.COMPLETEflash.events.Event 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. loadString()load()HTMLLoader Creates an HTMLLoader object. Creates an HTMLLoader object. cancelLoad Cancels any load operation in progress. Cancels any load operation in progress. createRootWindow Creates a new NativeWindow object that contains an HTMLLoader object.A new HTMLLoader object that is on the stage of the new NativeWindow object. flash.html:HTMLLoadervisibleBooleantrueSpecifies whether the window is visible. windowInitOptionsflash.display:NativeWindowInitOptionsnullSpecifies window initialization options; if null, uses default NativeWindowInitOptions values. scrollBarsVisibleBooleantrueSpecifies whether the window provides scrollbars. boundsflash.geom:RectanglenullIf 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. 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.

As the window loads content and applies stylesheets, minor graphics glitches can occur. To prevent such discontinuities from being visible, set the visible parameter to false. When the window has loaded and layed out its content, reveal it by setting the window.nativeWindow.visible property to true or call the window.nativeWindow.activate() method.

getHistoryAt Returns the history entry at the specified position.A URLRequest object for the history entry at the specified position. flash.html:HTMLHistoryItempositionuintThe position in the history list. Returns the history entry at the specified position. historyPositionhistoryBack Navigates back in the browser history, if possible. 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.

historyPosition
historyForward Navigates forward in the browser history, if possible. 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.

historyPosition
historyGo Navigates the specified number of steps in the browser history.stepsintThe number of steps in the history list to move forward (positive) or backward (negative). 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.

historyPosition
loadString Loads the HTMLLoader object with the HTML content contained in the HTML string.htmlContentStringThe string containing the HTML content to load into the HTMLLoader object. 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.

placeLoadStringContentInApplicationSandbox
load Loads the HTMLLoader object with data from the site specified by the urlRequestToLoad parameter.urlRequestToLoadflash.net:URLRequestThe 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. 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.

flash.net.URLRequest
reload Reloads the page from the current location. Reloads the page from the current location. authenticate Specifies whether authentication requests should be handled (true) or not (false) for HTTP requests issued by this object.Booleaninitialized from URLRequestDefaults.authenticate 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. flash.net.URLRequest.authenticateflash.net.URLRequestDefaults.authenticatecacheResponse Specifies whether successful response data should be cached for HTTP requests issued by this object.Booleaninitialized from URLRequestDefaults.cacheResponse 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. flash.net.URLRequestDefaults.cacheResponsecontentHeight The height, in pixels, of the HTML content.Number 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. contentWidth The width, in pixels, of the HTML content.Number 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. hasFocusableContent Indicates whether any content in the HTMLLoader object is focusable.Boolean Indicates whether any content in the HTMLLoader object is focusable. height Specifies the height of the rectangle of the HTML canvas that is being rendered.Number Specifies the height of the rectangle of the HTML canvas that is being rendered. This property value is the height of the HTMLLoader display object in pixels. The maximum height value is 4095 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 the content is not scaled (as would happen with other types of display objects).

historyLength The overall length of the history list, including back and forward entries.uint 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. historyPositionhistoryPosition The current position in the history list.uint 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. getHistoryAt()historyBack()historyGo()historyForward()historyLengthhtmlHost The HTMLHost object used to handle changes to certain user interface elements, such as the window.document.title property of the HTMLLoader object.flash.html:HTMLHostThe HTMLHost object used to handle changes to certain user interface elements, such as the window.document.title property of the HTMLLoader object. 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. HTMLHost classidleTimeout Specifies the idle timeout value (in milliseconds) for HTTP requests issued by this object.Numberinitialized from URLRequestDefaults.idleTimeout Specifies the idle timeout value (in milliseconds) for HTTP requests issued by this object.

The idle timeout is the amount of time the client waits for a response from the server, after the connection is established, before abandoning the request.

URLRequestDefaults.idleTimeout
isSupported Indicates whether the HTMLLoader class is supported on the client system.Boolean Indicates whether the HTMLLoader class is supported on the client system. loaded 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.Boolean 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. location The URL for the content loaded in the HTMLLoader object.String The URL for the content loaded in the HTMLLoader object. manageCookies Specifies whether the HTTP protocol stack should manage cookies for this object.Booleaninitialized from URLRequestDefaults.manageCookies 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. flash.net.URLRequest.manageCookiesflash.net.URLRequestDefaults.manageCookiesnavigateInSystemBrowser 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).Booleanfalse Whether navigation of the root frame of the HTML content results in navigation in the HTMLLoader object (false) or in the default system web browser (true). 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). paintsDefaultBackground Specifies whether the background of the HTMLLoader document is opaque white (true) or not (false).BooleanDetermines whether the background of the HTMLLoader document is opaque white (true) or not (false). 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. pdfCapability The type of PDF support on the user's system, defined as an integer code value.int 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 constantMeaningSTATUS_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.
HTMLPDFCapability class
placeLoadStringContentInApplicationSandbox Specifies whether content loaded via the loadString() method is put in the application sandbox (true) or in a non-application sandbox (false).Booleanfalse 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.

loadString()
runtimeApplicationDomain The application domain to use for the window.runtime object in JavaScript in the HTML page.flash.system:ApplicationDomainif the ApplicationDomain object is not from the caller's security domain. SecurityErrorSecurityErrorThe application domain to use for the window.runtime object in JavaScript in the HTML page. 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.

flash.system.ApplicationDomainflash.system.SecurityDomain
scrollH The horizontal scroll position of the HTML content in the HTMLLoader object.Number The horizontal scroll position of the HTML content in the HTMLLoader object. scrollV The vertical scroll position of the HTML content in the HTMLLoader object.Number The vertical scroll position of the HTML content in the HTMLLoader object. swfCapability The type of SWF support on the user's system, defined as an integer code value.int The type of SWF support on the user's system, defined as an integer code value. An HTMLLoader object can display SWF content only if this property evaluates to HTMLSWFCapability.STATUS_OK. The HTMLSWFCapability class defines constants for possible values of the swfCapability property, as follows: HTMLSWFCapability constantMeaningSTATUS_OKA sufficient version of Adobe Flash Player is detected and SWF content can be loaded in an HTMLLoader object.ERROR_INSTALLED_PLAYER_NOT_FOUNDNo version of Adobe Flash Player is detected. An HTMLLoader object cannot display SWF content.ERROR_INSTALLED_PLAYER_TOO_OLDAdobe Flash Player has been detected, but the version is too old. An HTMLLoader object cannot display SWF content. HTMLSWFCapability classtextEncodingFallback The character encoding used by the HTMLLoader content if an HTML page does not specify a character encoding.String 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.

textEncodingOverride
textEncodingOverride The character encoding used by the HTMLLoader content, overriding any setting in the HTML page.String 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.

textEncodingFallback
useCache Specifies whether the local cache should be consulted before HTTP requests issued by this object fetch data.Booleaninitialized from URLRequestDefaults.useCache Specifies whether the local cache should be consulted before HTTP requests issued by this object fetch data. flash.net.URLRequest.useCacheflash.net.URLRequestDefaults.useCacheuserAgent The user agent string to be used in any upcoming content requests from this HTMLLoader object.String 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"
flash.net.URLRequest.userAgentflash.net.URLRequestDefaults.userAgent
width Specifies the width of the rectangle of the HTML canvas that is being rendered.Number 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. The maximum width value is 4095 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). window The global JavaScript object for the content loaded into the HTML control.Object The global JavaScript object for the content loaded into the HTML control.
HTMLWindowCreateOptions This class defines the options that can be specified when JavaScript running in an HTMLLoader object tries to create a new HTML window by calling the window.open() method.Object This class defines the options that can be specified when JavaScript running in an HTMLLoader object tries to create a new HTML window by calling the window.open() method.

This class defines the properties and methods that correspond to options in the features parameter passed to the window.open() method in JavaScript.

For example, JavaScript in an HTML document (in an HTMLLoader object) can include the following call to window.open(), in which the features parameter (the third parameter) lists a number of options:

window.open("http://www.adobe.com", "AdobeWindow", "scrollbars=1,menubar=1,location=0,status=0")

You use the HTMLWindowCreateOptions class in overriding the createWindow() method of a subclass of the HTMLHost class. The HTMLLoader object passes an HTMLWindowCreateOptions object as the windowCreateOptions parameter of the createWindow() method of the HTMLHost object.

HTMLHost#createWindow()fullscreen Specifies whether the window should be full screen.falseBoolean Specifies whether the window should be full screen. This property is set to true if the features string of the JavaScript call to the window.open() method includes "fullscreen", "fullscreen=1", or "fullscreen=y". height Specifies the desired initial height of the new window.NaNNumber Specifies the desired initial height of the new window. This is set to the height value in the features string of the JavaScript call to the window.open() method. If the value is NaN, the default when no height value is specified in the features string, then a default window height is used. locationBarVisible Whether a location bar should be displayed.falseBoolean Whether a location bar should be displayed. This property is set to true if the features string of the JavaScript call to the window.open() method includes "location", "location=1", or "location=y". menuBarVisible Specifies whether a menu bar should be displayed.falseBoolean Specifies whether a menu bar should be displayed. This property is set to true if the features string of the JavaScript call to the window.open() method includes "menubar", "menubar=1", or "menubar=y". resizable Specifies whether the window should be resizable.falseBoolean Specifies whether the window should be resizable. This property is set to true if the features string of the JavaScript call to the window.open() method includes "resizable", "resizable=1", or "resizable=y". scrollBarsVisible Specifies whether scrollbars should be displayed.trueBoolean Specifies whether scrollbars should be displayed. This property is set to true if the features string of JavaScript call to the window.open() method includes "scrollbars", "scrollbars=1", or "scrollbars=y". statusBarVisible Specifies whether a status bar should be displayed.falseBoolean Specifies whether a status bar should be displayed. This property is set to true if the features string of the JavaScript call to the window.open() method includes "status", "status=1", or "status=y". toolBarVisible Specifies whether a toolbar bar should be displayed.falseBoolean Specifies whether a toolbar bar should be displayed. This property is set to true if the features string of the JavaScript call to the window.open() method includes "toolbar", "toolbar=1", or "toolbar=y". width Specifies the desired initial width of the new window.NaNNumber Specifies the desired initial width of the new window. This is set to the width value in the features string of the JavaScript call to the window.open() method. If the value is NaN, the default when no width value is specified in the features string, then a default window width is used. x Specifies the desired initial x position of the new window on the screen.NaNNumber Specifies the desired initial x position of the new window on the screen. This is set to the value specified for left or screenX in the features string of the JavaScript call to the window.open() method. If the value is NaN, the default when no left or screenX value is specified in the features string, then a default window x position is used. y Specifies the desired initial y position of the new window on the screen.NaNNumber Specifies the desired initial y position of the new window on the screen. This is set to the value specified for top or screenY in the features string of the JavaScript call to the window.open() method. If the value is NaN, the default when no left or screenX value is specified in the features string, then a default window x position is used.