Loader class

Inheritance UIObject > UIComponent > View > Loader

ActionScript Class Namespace mx.controls.Loader

The properties of the Loader class allow you to set content to load and monitor its loading progress at runtime.

Setting a property of the Loader class with ActionScript overrides the parameter of the same name set in the Property inspector or Component Inspector panel.

For more information, see Creating custom focus navigation.

Each component class has a version property which is a class property. Class properties are only available on the class itself. The version property returns a string that indicates the version of the component. To access the version property, use the following code:

trace(mx.controls.Loader.version);

Note: The following code returns undefined: trace(myLoaderInstance.version);.

Method summary for the Loader class

Method

Description

Loader.load()

Loads the content specified by the contentPath property.

Inherits all methods from UIObject class and UIComponent class.

Property summary for the Loader class

Property

Description

Loader.autoLoad

A Boolean value that indicates whether the content loads automatically (true) or if you must call Loader.load() (false).

Loader.bytesLoaded

A read-only property that indicates the number of bytes that have been loaded.

Loader.bytesTotal

A read-only property that indicates the total number of bytes in the content.

Loader.content

A reference to the content specified by the Loader.contentPath property. This property is read-only.

Loader.contentPath

A string that indicates the URL of the content to be loaded.

Loader.percentLoaded

A number that indicates the percentage of loaded content. This property is read-only.

Loader.scaleContent

A Boolean value that indicates whether the content scales to fit the Loader (true), or the Loader scales to fit the content (false).

Inherits all properties from UIObject class and UIComponent class.

Event summary for the Loader class

Event

Description

Loader.complete

Triggered when the content finished loading.

Loader.progress

Triggered while content is loading.

Inherits all properties from UIObject class and UIComponent class