KoolMoves AS3 API Documentation | All Packages | All Classes | Index | Frames No Frames |
Class AltLoader

Package | km.display
Class | public class AltLoader
Inheritance | AltLoader flash.display.Sprite

The AltLoader class is used to load alternative content not supported by the Loader class.
Currently only content types 'text' and 'htmlText' are supported.

Example

    import km.display.*;

    var l:AltLoader = new AltLoader();
    l.setDesiredSize(300);
    l.load(new URLRequest('myTextFile.txt'));

    addChild(l);

Public Properties

| Property | Defined by
--- | --- | ---
|  | content : DisplayObject [read-only] Returns a reference to the content loaded with load() or loadBytes() . | AltLoader
|  | contentLoaderInfo : AltLoaderInfo [read-only] The contentLoaderInfo object contains information about load progress and content dimensions. Supported properties are 'width', 'height', 'bytesLoaded' and 'bytesTotal' . The contentLoaderInfo object also broadcasts 'complete', 'httpStatus', 'ioError', 'open', 'progress' and 'securityError' events to monitor a load() . | AltLoader
|  | defaultTextFormat : TextFormat The default text format for text content. | AltLoader

Public Methods

| Method | Defined by
--- | --- | ---
|  | AltLoader() | AltLoader
|  | close():void Cancels a load() method currently in progress. | AltLoader
|  | load(request:URLRequest, contentType:String = "text", bgColor:uint = 0xffffff):void Loads content. | AltLoader
|  | loadBytes(bytes:ByteArray, contentType:String = "text", bgColor:uint = 0xffffff):void Loads content from a ByteArray instead of from a file. | AltLoader
|  | setDesiredSize(width:int, height:int = 0):void Sets the desired AltLoader size for the content to be loaded. | AltLoader
|  | unload():void Removes content previously loaded with load() or loadBytes() . | AltLoader

Property detail

content | property

`content:DisplayObject` [read-only]

Returns a reference to the content loaded with load() or loadBytes() .

Implementation
`public function get content():DisplayObject`

contentLoaderInfo | property |

`contentLoaderInfo:AltLoaderInfo` [read-only]

The contentLoaderInfo object contains information about load progress and content dimensions.
Supported properties are 'width', 'height', 'bytesLoaded' and 'bytesTotal' .
The contentLoaderInfo object also broadcasts 'complete', 'httpStatus', 'ioError', 'open', 'progress' and 'securityError' events to monitor a load() .

Implementation
`public function get contentLoaderInfo():AltLoaderInfo`

defaultTextFormat | property |

`public var defaultTextFormat:TextFormat`

The default text format for text content.

Constructor detail

AltLoader | () | constructor

`public function AltLoader()`
Method detail

close | () | method

`public function close():void`

Cancels a load() method currently in progress.

load | () | method |

`public function load(request:URLRequest, contentType:String = "text", bgColor:uint = 0xffffff):void`

Loads content.

Parameters

| `request:URLRequest`
| `contentType:String` (default = "`text`")``
| `bgColor:uint` (default = `0xffffff`)``

loadBytes | () | method |

`public function loadBytes(bytes:ByteArray, contentType:String = "text", bgColor:uint = 0xffffff):void`

Loads content from a ByteArray instead of from a file.

Parameters

| `bytes:ByteArray`
| `contentType:String` (default = "`text`")``
| `bgColor:uint` (default = `0xffffff`)``

setDesiredSize | () | method |

`public function setDesiredSize(width:int, height:int = 0):void`

Sets the desired AltLoader size for the content to be loaded.

Parameters

| `width:int`
| `height:int` (default = `0`)``

unload | () | method |

`public function unload():void`

Removes content previously loaded with load() or loadBytes() .

Last update : 04/05/2008