var pixBitMapData:BitmapData;
var theScaleMatrix:Matrix;
var pixMap:Bitmap;
var maisaikeshuliang:Number=50;
var my_Spr:Sprite;
function _masaike(oldDataMovieClip:MovieClip,p:Number):void {
if (pixBitMapData) {
pixBitMapData=null;
}
if (theScaleMatrix ) {
theScaleMatrix =null;
}
pixBitMapData = new BitmapData(oldDataMovieClip.width / p, oldDataMovieClip.height /p, true, 0);
theScaleMatrix = new Matrix;
my_Spr=new Sprite();
theScaleMatrix.scale(1 / p, 1 / p);
pixBitMapData.draw(oldDataMovieClip, theScaleMatrix);
pixMap = new Bitmap(pixBitMapData);
oldDataMovieClip.addChild(pixMap);
//oldDataMovieClip.addChild();
pixMap.addEventListener(MouseEvent.CLICK,getColor)
pixMap.width = oldDataMovieClip.width;
pixMap.height = oldDataMovieClip.height;
}
mc.addEventListener(MouseEvent.CLICK,_chang);
function _chang(e:MouseEvent):void {
_masaike(mc,maisaikeshuliang);
mc.mouseEnabled=false;
}
function getColor(e:MouseEvent):void{
trace("get it ")
}
|