C continued before the softening feel that the bitmapdata function to do a lot of the effect before, especially in the production of artboards need the eyedropper tool, here as long as a line of functions can get the color we want. That's convenient.
Click to browse the file
MovieClip.prototype.smoothImageLoad = function (img) {//Soft picture
var m = this.createemptymovieclip ("MC", This.getnexthighestdepth ());
var listener = new Moviecliploader ();
Listener.onloadcomplete = function (mc:movieclip) {
Mc.onenterframe = function () {
var bitmap = new Flash.display.BitmapData (this._width, this._height);
Bitmap.draw (this);
This.attachbitmap (bitmap, 1, true, true);
This.smoothimageloadcomplete ();
Updateafterevent ();
}
};
Listener.loadclip (IMG, m);
};
MovieClip.prototype.pickColor = function () {//Get picture color
var bitmap = new Flash.display.BitmapData (this._width, this._height);
Bitmap.draw (this);
if (bitmap!= undefined) {
var mycolor = Bitmap.getpixel (This._xmouse, this._ymouse);
Return "0x" + mycolor.tostring. toUpperCase ();
}
}
This.createemptymovieclip ("MC", 0);
Mc.smoothimageload ("doggy.jpg");
Mc._xscale = mc._yscale=300;
This.onmousemove = function () {
MyColor = Mc.pickcolor (); Get the color function of the picture
var colortansform = new Flash.geom.ColorTransform ();
Colortansform.rgb = MyColor;
ColorMc.transform.colorTransform = Colortansform;
Colortxt.text = MyColor;
Updateafterevent ();
}