ImageLoad

Kind of class:public class
Package:org.casalib.load
Inherits from:CasaLoader < LoadItem < Process < RemovableEventDispatcher < EventDispatcher
Version:09/06/09
Author:Aaron Clinger
Classpath:org.casalib.load.ImageLoad
File last modified:Sunday, 06 September 2009, 08:46:25
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.
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.

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.

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.