用实验中的Actionscript 3.0实现颜色拾取
?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;
};示例:
源文件:
colorPick_Bliss.rar
本文转自:http://www.5uflash.com/flashjiaocheng/Flash-as3-jiaocheng/312.html