CasaLoader

Kind of class:public class
Package:org.casalib.load
Inherits from:LoadItem < Process < RemovableEventDispatcher < EventDispatcher
Known subclasses:
Version:09/06/09
Author:Aaron Clinger
Classpath:org.casalib.load.CasaLoader
File last modified:Sunday, 06 September 2009, 08:46:40
Wraps Loader and extends from LoadItem and Process.

In almost all cases you will want to use ImageLoad or SwfLoad instead of this class.
Example:
  • package {
        import org.casalib.display.CasaMovieClip;
        import org.casalib.events.LoadEvent;
        import org.casalib.load.CasaLoader;
    
    
        public class MyExample extends CasaMovieClip {
            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: 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.
Constants
Class properties
Class properties inherited from Process
Instance properties
  • loader : Loader
    • The Loader being used to load the image or SWF.
  • content : DisplayObject
    • The content received from the CasaLoader.
  • loaderInfo : LoaderInfo
    • The LoaderInfo corresponding to the object being loaded.
  • 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.

Constants

FLASH_CONTENT_TYPE

public static const FLASH_CONTENT_TYPE:String = 'application/x-shockwave-flash'
(read)

GIF_CONTENT_TYPE

public static const GIF_CONTENT_TYPE:String = 'image/gif'
(read)

JPEG_CONTENT_TYPE

public static const JPEG_CONTENT_TYPE:String = 'image/jpeg'
(read)

PNG_CONTENT_TYPE

public static const PNG_CONTENT_TYPE:String = 'image/png'
(read)

Instance properties

bytesLoaded

override public bytesLoaded:uint
(read)

The number of bytes loaded of the requested file.

content

public content:DisplayObject
(read)

The content received from the CasaLoader. Available after load is complete.
Throws:
  • Error if method is called before the SWF has loaded.

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: