home *** CD-ROM | disk | FTP | other *** search
- class com.argosy.ui.ImageLoader extends com.argosy.ui.baseUI
- {
- var content_mc;
- var loader;
- var dispatchEvent;
- function ImageLoader()
- {
- super();
- }
- function clearImage()
- {
- this.content_mc.image.removeMovieClip();
- }
- function loadImage(url)
- {
- trace("loadImage: " + url);
- this.content_mc.image.removeMovieClip();
- this.content_mc.createEmptyMovieClip("image",100);
- this.loader.loadClip(url,this.content_mc.image);
- }
- function init()
- {
- this.loader = new MovieClipLoader();
- this.loader.addListener(this);
- super.init();
- }
- function createChildren()
- {
- this.content_mc = this.createEmptyMovieClip("content_mc",100);
- this.content_mc.cacheAsBitmap = true;
- }
- function fadeInImage()
- {
- new mx.transitions.Tween(this.content_mc.image,"_alpha",mx.transitions.easing.None.easeOut,0,100,5,true);
- }
- function scaleImage()
- {
- if(this.content_mc.image._width > this.width || this.content_mc.image._height > this.height)
- {
- var _loc2_ = 1 * Math.max(this.width / this.content_mc.image._width,this.height / this.content_mc.image._height) * 100;
- this.content_mc.image._xscale = _loc2_;
- this.content_mc.image._yscale = _loc2_;
- }
- }
- function layout()
- {
- }
- function onLoadInit(target_mc)
- {
- this.scaleImage();
- this.dispatchEvent({type:"image_load",target:this});
- }
- function onLoadStart(target_mc)
- {
- }
- function onLoadError(target_mc, errorCode)
- {
- trace("onLoadError: " + errorCode);
- this.dispatchEvent({type:"image_error",target:this,error:errorCode});
- }
- function onLoadProgress(target_mc, loadedBytes, totalBytes)
- {
- }
- function onLoadComplete(target_mc)
- {
- }
- }
-