Constructors

Properties

Methods

SequentialLoader class

SequentialLoader

extends EventDispatcher

 

 

Overview

Author

Matt Przybylski [http://www.reintroducing.com]

Version

1.1

Description

The SequentialLoader loads a series of SWFs and/or images in an ordered sequence. This is a conversion of the AS2 SequentialLoader class originally written by Tom Stanley [http://www.staticmethods.com] with some additional methods added for more control.

The class dispatches a custom SequentialLoaderEvent depending on what happens. The events are as follows:

  • SequentialLoaderEvent.ON_ITEM_START: Dispatched when an item starts to load (params object contains index)
  • SequentialLoaderEvent.ON_ITEM_PROGRESS: Dispatched while an item is loading (params object contains index, percent loaded, bytesLoaded, bytesTotal)
  • SequentialLoaderEvent.ON_ITEM_INIT: Dispatched when an item is loaded (params object contains index, asset)
  • SequentialLoaderEvent.ON_ITEM_SKIPPED: Dispatched when an item fails to load (params object contains index)
  • SequentialLoaderEvent.ON_SEQUENCE_COMPLETE: Dispatched when every item in the sequence has finished loading

Constructors

 

SequentialLoader

Usage

public function SequentialLoader($assets:Array, $pauseAfterEachLoad:Boolean = false, $checkPolicyFile:Boolean = false):void

Description

Creates a new instance of the SequentialLoader class and passes in the assets to load. You can set the optional pauseAfterEachLoad boolean which allows you to pause after each item is loaded to do another action and then resume the SequentialLoader using the resume() method.

Parameters

$assets
An array that holds the paths to the SWFs/images to be loaded
$pauseAfterEachLoad
An optional boolean that allows you to pause the SequentialLoader after each item is loaded (default: false)
$checkPolicyFile
An optional boolean that checks to see if a policy file should be loaded or not on the first load (default: false)

Properties

 

isPaused

Usage

public function get isPaused():Boolean

Description

Returns the value of isPaused.Sets the value of isPaused.
 

pauseAfterEachLoad

Usage

public function get pauseAfterEachLoad():Boolean

Description

Returns the value of pauseAfterEachLoad.Sets the value of pauseAfterEachLoad.

Methods

 

start

Usage

public function start():void

Description

Starts the loading of the specified assets.

Returns

void
 

pause

Usage

public function pause():void

Description

Pauses the SequentialLoader at its current loading position.

Returns

void
 

resume

Usage

public function resume():void

Description

Resume the SequentialLoader and load the next asset in the loading sequence.

Returns

void
 

destroy

Usage

public function destroy():void

Description

Cleans up the listeners used by the current Loader.

Returns

void