Package | com.yworks.util |
Class | public class ImageLoader |
Inheritance | ImageLoader flash.events.EventDispatcher |
addedToDisplayList
is called and a Stage object is
found then.
Property | Defined By | ||
---|---|---|---|
image : DisplayObject
The image instance that was loaded by this loader. | ImageLoader |
Method | Defined By | ||
---|---|---|---|
ImageLoader(errorFunction:Function = null)
Creates a new ImageLoader. | ImageLoader | ||
addedToDisplayList(parent:UIComponent):void
If the load( url ) function was called earlier and the image couldn't be loaded
at that time, this method causes the loader to try loading again. | ImageLoader | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0.0, useWeakReference:Boolean = false):void [override]
| ImageLoader | ||
load(url:String, swf:Boolean = false):Boolean
Try to load an image from the given url. | ImageLoader | ||
loadBase64(base64:String, digest:String = null):void
Creates an image from a base64 encoded String
| ImageLoader |
Event | Summary | Defined By | ||
---|---|---|---|---|
Dispatched when the image has been loaded. | ImageLoader |
image | property |
image:DisplayObject
The image instance that was loaded by this loader.
If the image was loaded correctly, this will usually be a
com.yworks.util.CloneableBitmap
instance.
public function get image():DisplayObject
public function set image(value:DisplayObject):void
ImageLoader | () | Constructor |
public function ImageLoader(errorFunction:Function = null)
Creates a new ImageLoader.
ParameterserrorFunction:Function (default = null ) — A function that is executed when loading fails.
|
addedToDisplayList | () | method |
public function addedToDisplayList(parent:UIComponent):void
If the load( url ) function was called earlier and the image couldn't be loaded at that time, this method causes the loader to try loading again. Whether the loader actually tries to load the image depends on whether a Stage object is found using the given UIComponent. When loading has completed successfully, the "complete" event will be fired.
Parameters
parent:UIComponent |
addEventListener | () | method |
override public function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0.0, useWeakReference:Boolean = false):void
Parameters
type:String | |
listener:Function | |
useCapture:Boolean (default = false )
| |
priority:int (default = 0.0 )
| |
useWeakReference:Boolean (default = false )
|
load | () | method |
public function load(url:String, swf:Boolean = false):Boolean
Try to load an image from the given url.
If the image is already contained in the com.yworks.util.BitmapCache
,
it won't be loaded again. If no Stage object can be found, the loading will be delayed until
addedToDisplayList
is called.
When loading has completed successfully, the "complete" event will be fired.
Parameters
url:String — The url to load the image from.
| |
swf:Boolean (default = false ) — whether the file located at the given url is a swf file. This parameter is deprecated.
|
Boolean — true , if loading could be started. false , if addedToDisplayList
will have to be called to actually load the image.
|
loadBase64 | () | method |
public function loadBase64(base64:String, digest:String = null):void
Creates an image from a base64 encoded String
Parameters
base64:String — The base64 encoded String
| |
digest:String (default = null ) — Key for the BitmapCache . If none is provided, the SHA1 checksum of the base64 String is used.
|
complete | Event |
flash.events.Event
flash.events.Event.COMPLETE
Dispatched when the image has been loaded.