Packageorg.ow2.kerneos.core.view.preloader
Classpublic class PreloaderDisplayBase
InheritancePreloaderDisplayBase Inheritance flash.display.Sprite
Implements mx.preloaders.IPreloaderDisplay
Subclasses KerneosPreloader

The base mechanism for a custom preloader. Massively inspired from http://www.pathf.com/blogs/2008/08/custom-flex-3-lightweight-preloader-with-source-code/ .

See also

KerneosPreloader


Public Properties
 PropertyDefined By
  backgroundAlpha : Number
The background alpha.
PreloaderDisplayBase
  backgroundColor : uint
The background color.
PreloaderDisplayBase
  backgroundImage : Object
The background image.
PreloaderDisplayBase
  backgroundSize : String
The background size.
PreloaderDisplayBase
  preloader : Sprite
[write-only] The Preloader class passes in a reference to itself to the display class so that it can listen for events from the preloader.
PreloaderDisplayBase
  stageHeight : Number
The stage height.
PreloaderDisplayBase
  stageWidth : Number
The stage width.
PreloaderDisplayBase
Protected Properties
 PropertyDefined By
  _backgroundColor : uint = 0xffffffff
The background color.
PreloaderDisplayBase
  _bytesExpected : uint = 1
The number of bytes expected.
PreloaderDisplayBase
  _bytesLoaded : uint = 0
The number of bytes already loaded.
PreloaderDisplayBase
  _fractionLoaded : Number = 0
The percentage loaded.
PreloaderDisplayBase
  _IsInitComplete : Boolean = false
Whether the initialization is complete.
PreloaderDisplayBase
  _preloader : Sprite
The actual preloader.
PreloaderDisplayBase
  _stageHeight : Number = 300
The stage height.
PreloaderDisplayBase
  _stageWidth : Number = 400
The stage width.
PreloaderDisplayBase
  _timer : Timer
The timer used to update the UI.
PreloaderDisplayBase
Public Methods
 MethodDefined By
  
Build a new PreloaderDisplayBase.
PreloaderDisplayBase
  
initialize():void
This function is called when the PreloaderDisplayBase has been created and is ready for action.
PreloaderDisplayBase
Protected Methods
 MethodDefined By
  
completeHandler(event:Event):void
Handler for the download complete event.
PreloaderDisplayBase
  
draw():void
This function is called whenever the state of the preloader changes: to be overriden.
PreloaderDisplayBase
  
initCompleteHandler(event:Event):void
Handler for the initialization complete event.
PreloaderDisplayBase
  
initProgressHandler(event:Event):void
Handler for initiialization progress events.
PreloaderDisplayBase
  
progressHandler(event:ProgressEvent):void
Handler for download progress events.
PreloaderDisplayBase
  
timerHandler(event:Event):void
Handler for the UI update timer.
PreloaderDisplayBase
Property Detail
_backgroundColorproperty
protected var _backgroundColor:uint = 0xffffffff

The background color.

_bytesExpectedproperty 
protected var _bytesExpected:uint = 1

The number of bytes expected.

_bytesLoadedproperty 
protected var _bytesLoaded:uint = 0

The number of bytes already loaded.

_fractionLoadedproperty 
protected var _fractionLoaded:Number = 0

The percentage loaded.

_IsInitCompleteproperty 
protected var _IsInitComplete:Boolean = false

Whether the initialization is complete.

_preloaderproperty 
protected var _preloader:Sprite

The actual preloader.

_stageHeightproperty 
protected var _stageHeight:Number = 300

The stage height.

_stageWidthproperty 
protected var _stageWidth:Number = 400

The stage width.

_timerproperty 
protected var _timer:Timer

The timer used to update the UI.

backgroundAlphaproperty 
backgroundAlpha:Number

The background alpha.


Implementation
    public function get backgroundAlpha():Number
    public function set backgroundAlpha(value:Number):void
backgroundColorproperty 
backgroundColor:uint

The background color.


Implementation
    public function get backgroundColor():uint
    public function set backgroundColor(value:uint):void
backgroundImageproperty 
backgroundImage:Object

The background image.


Implementation
    public function get backgroundImage():Object
    public function set backgroundImage(value:Object):void
backgroundSizeproperty 
backgroundSize:String

The background size.


Implementation
    public function get backgroundSize():String
    public function set backgroundSize(value:String):void
preloaderproperty 
preloader:Sprite  [write-only]

The Preloader class passes in a reference to itself to the display class so that it can listen for events from the preloader.


Implementation
    public function set preloader(value:Sprite):void
stageHeightproperty 
stageHeight:Number

The stage height.


Implementation
    public function get stageHeight():Number
    public function set stageHeight(value:Number):void
stageWidthproperty 
stageWidth:Number

The stage width.


Implementation
    public function get stageWidth():Number
    public function set stageWidth(value:Number):void
Constructor Detail
PreloaderDisplayBase()Constructor
public function PreloaderDisplayBase()

Build a new PreloaderDisplayBase.

Method Detail
completeHandler()method
protected function completeHandler(event:Event):void

Handler for the download complete event. Called when the download is complete, but initialization might not be done yet. There are two phases: download and init.

Parameters

event:Event

draw()method 
protected function draw():void

This function is called whenever the state of the preloader changes: to be overriden. Use the _fractionLoaded variable to draw your progress bar.

initCompleteHandler()method 
protected function initCompleteHandler(event:Event):void

Handler for the initialization complete event. Called when the initialization is complete, but initialization might not be done yet. There are two phases: download and init.

Parameters

event:Event

initialize()method 
public function initialize():void

This function is called when the PreloaderDisplayBase has been created and is ready for action.

initProgressHandler()method 
protected function initProgressHandler(event:Event):void

Handler for initiialization progress events.

Parameters

event:Event

progressHandler()method 
protected function progressHandler(event:ProgressEvent):void

Handler for download progress events.

Parameters

event:ProgressEvent

timerHandler()method 
protected function timerHandler(event:Event):void

Handler for the UI update timer. Called as often as possible.

Parameters

event:Event