CasaLoader

Kind of class:public class
Package:org.casalib.load
Inherits from:LoadItem < BaseLoadItem < Process < RemovableEventDispatcher < EventDispatcher
Known subclasses:
Version:01/20/09
Author:Aaron Clinger
Classpath:org.casalib.load.CasaLoader
File last modified:Tuesday, 20 January 2009, 16:21:07
Wraps Loader and extends from LoadItem, BaseLoadItem and Process.

In almost all cases you will want to use GraphicLoad or LibraryLoad instead of this class.
Example:
  • package {
        import flash.display.MovieClip;
        import org.casalib.events.LoadEvent;
        import org.casalib.load.CasaLoader;
    
    
        public class MyExample extends MovieClip {
            protected var _casaLoader:CasaLoader;
    
    
            public function MyExample() {
                super();
    
                this._casaLoader = new CasaLoader("test.jpg");
                this._casaLoader.addEventListener(LoadEvent.COMPLETE, this._onComplete);
                this._casaLoader.start();
            }
    
            protected function _onComplete(e:LoadEvent):void {
                this.addChild(this._casaLoader.loader);
            }
        }
    }
Events broadcasted to listeners:
  • Event with type: INIT - Dispatched when the properties and methods of a loaded SWF file are accessible.
  • Event with type: OPEN - Dispatched when a load operation starts.
  • Event with type: UNLOAD - Dispatched when unload is called.
  • HTTPStatusEvent with type: HTTP_STATUS - Dispatched if class is able to detect and return the status code for the request.
  • SecurityErrorEvent with type: SECURITY_ERROR - Dispatched if load is outside the security sandbox.

Summary


Constructor
  • CasaLoader (request:*, context:LoaderContext = null)
    • Creates and defines a CasaLoader.
Class properties
Class properties inherited from Process
Instance properties
  • loader : Loader
    • The Loader being used to load the image or SWF.
  • loaderInfo : LoaderInfo
    • The LoaderInfo corresponding to the object being loaded.
  • bytesTotal : uint
    • The total number of bytes of the requested file.
  • bytesLoaded : uint
    • The number of bytes loaded of the requested file.

Constructor

CasaLoader

public function CasaLoader (
request:*, context:LoaderContext = null)

Creates and defines a CasaLoader.
Parameters:
request:
A String or an URLRequest reference to the file you wish to load.
context:
An optional LoaderContext object.

Instance properties

bytesLoaded

override public bytesLoaded:uint
(read)

The number of bytes loaded of the requested file.

bytesTotal

override public bytesTotal:uint
(read)

The total number of bytes of the requested file.

loader

public loader:Loader
(read)

The Loader being used to load the image or SWF.

loaderInfo

public loaderInfo:LoaderInfo
(read)

The LoaderInfo corresponding to the object being loaded.

Instance methods

destroy

override public function destroy (
) : void

Overrides: