ImageLoad
| Kind of class: | public class |
|---|---|
| Package: | org.casalib.load |
| Inherits from: | CasaLoader < LoadItem < Process < RemovableEventDispatcher < EventDispatcher |
| Version: | 02/13/10 |
| Author: | Aaron Clinger |
| Classpath: | org.casalib.load.ImageLoad |
| File last modified: | Sunday, 28 March 2010, 11:55:55 |
Provides an easy and standardized way to load images.
Example:
-
package { import org.casalib.display.CasaMovieClip; import org.casalib.events.LoadEvent; import org.casalib.load.ImageLoad; public class MyExample extends CasaMovieClip { protected var _imageLoad:ImageLoad; public function MyExample() { super(); this._imageLoad = new ImageLoad("test.jpg"); this._imageLoad.addEventListener(LoadEvent.COMPLETE, this._onComplete); this._imageLoad.start(); } protected function _onComplete(e:LoadEvent):void { this.addChild(this._imageLoad.contentAsBitmap); } } }
Summary
Constructor
- ImageLoad (request:*, context:LoaderContext = null)
- Creates and defines an ImageLoad.
Constants
Constants inherited from CasaLoader
Class properties
Class properties inherited from Process
Instance properties
- contentAsBitmap : Bitmap
- The data received from the DataLoad data typed as Bitmap.
- contentAsBitmapData : BitmapData
- The data received from the DataLoad data typed as BitmapData.
Instance properties inherited from CasaLoader
Instance properties inherited from LoadItem
Instance properties inherited from Process
Instance properties inherited from RemovableEventDispatcher
Instance methods
Instance methods inherited from CasaLoader
Instance methods inherited from LoadItem
Constructor
ImageLoad
public function ImageLoad (
request:*,
context:LoaderContext = null)
Creates and defines an ImageLoad.
Parameters:
request:
A
String or an URLRequest reference to the file you wish to load.context:
An optional LoaderContext object.
Throws:
- ArguementTypeError if you pass a type other than a
Stringor anURLRequestto parameterrequest. - Error if you try to load an empty
StringorURLRequest.
Instance properties
contentAsBitmap
public contentAsBitmap:Bitmap
(read)
The data received from the DataLoad data typed as Bitmap. Available after load is complete.
Throws:
- Error if method is called before the SWF has loaded.
- Error if method cannot convert content to a Bitmap.
contentAsBitmapData
public contentAsBitmapData:BitmapData
(read)
The data received from the DataLoad data typed as BitmapData. Available after load is complete.
Throws:
- Error if method is called before the SWF has loaded.
- Error if method cannot convert content to BitmapData.