MovieClip.prototype.loadImage = function( fileName:String, height:Number, width:Number, center:Boolean ) { var w:MovieClip = this._parent.createEmptyMovieClip("watch", this._parent.getNextHighestDepth()); if (center) { w.parentWidth = this._parent._width; w._x = w.parentWidth/2-w._width/2; w.parentHeight = this._parent._height; w._y = w.parentHeight/2-w._height/2; } else { w._x = this._width/2-w._width/2; } if (this._height == 0) { w._y = this._parent._height/2.5; } else { w._y = this._y + this._height/2.5; } w.pic = this; w.onEnterFrame = function() { if (this.pic.getBytesLoaded()>15 && this.pic.getBytesLoaded()>=this.pic.getBytesTotal()) { if ((width == null || width == undefined) && height != null) { if (this.pic._height != height) { var scale:Number = height/this.pic._height; this.pic._width *= scale; this.pic._height *= scale; } } else if (width != null && height == null) { if (this.pic._width != width) { var scale:Number = width/this.pic._width; this.pic._width *= scale; this.pic._height *= scale; } } else if (width != null && height != null) { this.pic._width = width; this.pic._height = height; } if (center) { this.pic._x = this.parentWidth/2 - this.pic._width/2; this.pic._y = this.parentHeight/2 - this.pic._height/2; } delete this.onEnterFrame; this.removeMovieClip(); } }; this.loadMovie(fileName); } ASSetPropFlags(MovieClip.prototype, ["loadImage"], 7, 0);