Flash 8 中的柔化函數使用
新的Flash 8中发现了一个柔化图片的效果函数 smoothImageLoadComplete(),经过多次测试终于知道怎麽使用了,在这里提供给大家。
MovieClip.prototype.smoothImageLoad = function(img)
var listener = new MovieClipLoader();
listener.onLoadComplete = function(mc:MovieClip)
mc.onEnterFrame = function()
bitmap = new flash.display.BitmapData(this._width, this._height);
bitmap.draw(this);
this.attachBitmap(bitmap, 1, "auto", true);
this.smoothImageLoadComplete();
}
};
listener.loadClip(img, this);
};
this.createEmptyMovieClip("mc", 0);
mc.smoothImageLoad("doggy.jpg");
mc._xscale = mc._yscale=400;? //把圖片放大4倍
|