Packagecom.pblabs.engine.resource
Classpublic class ImageResource
InheritanceImageResource Inheritance Resource Inheritance flash.events.EventDispatcher

This is a Resource subclass for image data. It allows you to load an image file format supported by Flash (JPEG, PNG, or GIF) and access it as a BitmapData or Bitmap.



Public Properties
 PropertyDefined By
  bitmapData : BitmapData
[read-only] Get the raw BitmapData that was loaded.
ImageResource
 InheriteddidFail : Boolean
[read-only] Whether or not the resource failed to load.
Resource
 Inheritedfilename : String
The filename the resource data was loaded from.
Resource
  image : Bitmap
[read-only] Once the resource has succesfully loaded, this contains a Bitmap representing the loaded image.
ImageResource
 InheritedisLoaded : Boolean
[read-only] Whether or not the resource has been loaded.
Resource
 InheritedreferenceCount : int
[read-only] The number of places this resource is currently referenced from.
Resource
Protected Properties
 PropertyDefined By
  _bitmapData : BitmapData = null
ImageResource
 Inherited_filename : String = null
Resource
 InheritedresourceLoader : Loader
[read-only] The Loader object that was used to load this resource.
Resource
Public Methods
 MethodDefined By
 Inherited
Decrements the number of references to the resource.
Resource
  
dispose():void
[override] Disposes the bitmapData object of this ImageResource
ImageResource
 Inherited
fail(message:String):void
This method will be used by a Resource Provider to indicate that this resource has failed loading
Resource
 Inherited
Increments the number of references to the resource.
Resource
  
initialize(data:*):void
[override]
ImageResource
 Inherited
load(filename:String):void
Loads resource data from a file.
Resource
Protected Methods
 MethodDefined By
  
onContentReady(content:*):Boolean
[override] This is called when the resource data has been fully loaded and conditioned.
ImageResource
 Inherited
onFailed(message:String):void
Resource
 Inherited
onLoadComplete(event:Event = null):void
Called when loading and conditioning of the resource data is complete.
Resource
Events
 Event Summary Defined By
 Inherited This event is dispatched by a resource when loading of the resource's data fails.Resource
 Inherited This event is dispatched by a resource upon successful load of the resource's data.Resource
Property Detail
_bitmapDataproperty
protected var _bitmapData:BitmapData = null

bitmapDataproperty 
bitmapData:BitmapData  [read-only]

Get the raw BitmapData that was loaded.


Implementation
    public function get bitmapData():BitmapData
imageproperty 
image:Bitmap  [read-only]

Once the resource has succesfully loaded, this contains a Bitmap representing the loaded image. Because Bitmaps cannot be shared, this makes a new Bitmap every time it is called.


Implementation
    public function get image():Bitmap
Method Detail
dispose()method
override public function dispose():void

Disposes the bitmapData object of this ImageResource

initialize()method 
override public function initialize(data:*):void

Parameters

data:*

onContentReady()method 
override protected function onContentReady(content:*):Boolean

This is called when the resource data has been fully loaded and conditioned. Returning true from this method means the load was successful. False indicates failure. Subclasses must implement this method.

Parameters

content:* — The fully conditioned data for this resource.

Returns
Boolean — True if content contains valid data, false otherwise.