Packagekm.display
Classpublic class AltLoader
InheritanceAltLoader Inheritance 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
 PropertyDefined 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
 MethodDefined by
  
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
contentproperty
content:DisplayObject  [read-only]

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

Implementation
    public function get content():DisplayObject
contentLoaderInfoproperty 
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
defaultTextFormatproperty 
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() .