var linkageId = "Bliss.jpg";
var myBitmapData = flash.display.BitmapData.loadBitmap(linkageId);
var mc = this.createEmptyMovieClip("mc", this.getNextHighestDepth());
mc.attachBitmap(myBitmapData, this.getNextHighestDepth());
var colorTrans = new flash.geom.ColorTransform();
var rect = createRectangle(100, 20, 0x000000);
var trans = new flash.geom.Transform(rect);
onEnterFrame = function () {
colorTrans.rgb = myBitmapData.getPixel(_xmouse, _ymouse);
trans.colorTransform = colorTrans;
};示例:
源文件:点击这里下载源文件