hello all
this is function to load smooth external images
PHP Code:onFrame (1) {
MovieClip.prototype.LoadSmoothImage = function(Url,maxW,maxH,redraw) {
this.createEmptyMovieClip("mc",this.getNextHighestDepth());
this.mc.loadMovie(Url);
this.onEnterFrame = function() {
if (this.mc.getPercentLoaded() == 100) {
delete this.onEnterFrame
this.mc._xscale = this.mc._yscale = 100;
this.ow = this.mc._width;
this.oh = this.mc._height;
this.x_ratio = maxW / this.ow;
this.y_ratio = maxH / this.oh;
if (this.mc._width > maxW || this.mc._height > maxH) {
if ((this.x_ratio * this.oh) < maxH) {
this.mc._height = Math.ceil(this.x_ratio * this.oh);
this.mc._width = this.size._width;
} else {
this.mc._width = Math.ceil(this.y_ratio * this.ow);
this.mc._height = maxW;
}
}
if (redraw) {
this.bitmap=new flash.display.BitmapData(this.mc._width,this.mc._height, true, 0xff0000);
this.mc.attachBitmap(this.bitmap,this.mc.getNextHighestDepth(),"auto",true);
this.bitmap.draw(this.mc);
this.mc.forceSmoothing = true ;
}
}
}
}
for( i=1;i < 10;i++){
_parent["mc"+i].LoadSmoothImage(String(i)+".jpg",320,320,true);
}
}
i want add code to this function if image not found in url path
ex
if_parent["mc"+i] not found (i) .jpg====> parent["mc"+i] load "0.jpg"
thanks for help




Reply With Quote