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
In almost all cases you will want to use ImageLoad or SwfLoad instead of this class.
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 whenunloadis 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
- FLASH_CONTENT_TYPE : String
- JPEG_CONTENT_TYPE : String
- GIF_CONTENT_TYPE : String
- PNG_CONTENT_TYPE : String
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.
Instance properties inherited from LoadItem
Instance properties inherited from Process
Instance properties inherited from RemovableEventDispatcher
Instance methods
- destroy : void
Instance methods inherited from LoadItem
Instance methods inherited from RemovableEventDispatcher
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.