GraphicLoad
| Kind of class: | public class |
|---|---|
| Package: | org.casalib.load |
| Inherits from: | LoadItem < BaseLoadItem < Process < RemovableEventDispatcher < EventDispatcher |
| Version: | 11/02/08 |
| Author: | Aaron Clinger |
| Classpath: | org.casalib.load.GraphicLoad |
| File last modified: | Monday, 01 December 2008, 11:16:36 |
Provides an easy and standardized way to load images or SWF files.
Example:
-
package { import flash.display.MovieClip; import org.casalib.events.LoadEvent; import org.casalib.load.GraphicLoad; public class MyExample extends MovieClip { protected var _graphicLoad:GraphicLoad; public function MyExample() { super(); this._graphicLoad = new GraphicLoad("test.jpg"); this._graphicLoad.addEventListener(LoadEvent.COMPLETE, this._onComplete); this._graphicLoad.start(); } protected function _onComplete(e:LoadEvent):void { this.addChild(this._graphicLoad.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 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
- GraphicLoad (request:*, context:LoaderContext = null)
- Creates and defines a GraphicLoad.
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.
- content : DisplayObject
- The content received from the GraphicLoad.
- contentAsMovieClip : MovieClip
- The data received from the DataLoad data typed as MovieClip.
- contentAsBitmap : Bitmap
- The data received from the DataLoad data typed as Bitmap.
- contentAsBitmapData : BitmapData
- The data received from the DataLoad data typed as BitmapData.
- bytesTotal : uint
- The total number of bytes of the requested file.
- bytesLoaded : uint
- The number of bytes loaded of the requested file.
Instance properties inherited from LoadItem
Instance properties inherited from BaseLoadItem
Instance properties inherited from Process
Instance properties inherited from RemovableEventDispatcher
Instance methods
- destroy : void
Instance methods inherited from LoadItem
Instance methods inherited from BaseLoadItem
Instance methods inherited from RemovableEventDispatcher
Constructor
GraphicLoad
public function GraphicLoad (
request:*,
context:LoaderContext = null)
Creates and defines a GraphicLoad.
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.
content
public content:DisplayObject
(read)
The content received from the GraphicLoad. Available after load is complete.
contentAsBitmap
public contentAsBitmap:Bitmap
(read)
The data received from the DataLoad data typed as Bitmap. Available after load is complete.
contentAsBitmapData
public contentAsBitmapData:BitmapData
(read)
The data received from the DataLoad data typed as BitmapData. Available after load is complete.
contentAsMovieClip
public contentAsMovieClip:MovieClip
(read)
The data received from the DataLoad data typed as MovieClip. Available after load is complete.
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.