Class com.sekati.display.ImageClip

Implemented Interfaces

IImageClip

Description

ImageClip - load an image available for manipulation. NOTE: The clip image is automatically hidden (_alpha:0) until manually tweened in by developer.

 Usage:
 	import com.sekati.utils.*
 	import caurina.transitions.Tweener;
 	
 	function _onProgress(l:Number, t:Number):Void { trace("img_onProgress: "+l+" / "+t); }
 	function _onInit():Void { Tweener.addTween(image, {_alpha:100, time:0.3, transition:"easeInOutQuint"}); }
 	function _onError(code:String):Void { trace("oh noes! The image couldnt be loaded: "+ecode); }
 	
 	// create an empty ImageClip
 	var image:MovieClip =  ClassUtils.createEmptyMovieClip (com.sekati.display.ImageClip, this, "image", {_x:0, _y:0});
 	
 	// load an image and define onProgress onInit Delegates.
 	image.load("test.jpg", Delegate.create(this, _onInit), Delegate.create(this, _onProgress), Delegate.create(this, _onError));
 

Field Index

img

Method Index

new ImageClip()
load(), unload()

Inherited from BaseClip

Constructor Detail

ImageClip

public function ImageClip()

Constructor

Field Detail

img

public img:MovieClip

Method Detail

load

public function load(uri:String, onInit:Function, onProgress:Function, onError:Function):Void

Load an image

Parameters

uri(String)
onInit(Function) - cb when image is loaded, converted, ready for use.
onProgress(Function) - cb is passed args: bytesLoaded, bytesTotal.
onError(Function) - cb is passed arg errorCode, httpStatus.

Return

Void

Specified By

load() in com.sekati.display.IImageClip

unload

public function unload():Void

Remove the image.

Return

Void

Specified By

unload() in com.sekati.display.IImageClip