详细内容
flash制作镜面动画效果
flash制作镜面动画效果代码如下:
import flash.display.BitmapData;
import flash.geom.Matrix;
import com_zszen.spirit.create;
function mirror(mc:MovieClip,objSet:Object, newMC:String, type:String) {
var bd:BitmapData = new BitmapData(objSet.width, objSet.height, true, 0);
var tmc:MovieClip = create.Movie(mc._parent, newMC);
var bmc:MovieClip = create.Movie(tmc, "mc");
bd.draw(mc);
bmc.attachBitmap(bd, 1);
switch (type) {
case "h" :
bmc._x =objSet.width
bmc._xscale = -100;
break;
case "v" :
bmc._y = objSet.height
bmc._yscale = -100;
break;
case "hv" :
bmc._x = objSet.width
bmc._xscale = -100;
bmc._y =objSet.height
bmc._yscale = -100;
break;
case "vh" :
bmc._x =objSet.width
bmc._xscale = -100;
bmc._y =objSet.height
bmc._yscale = -100;
break;
default :
}
return tmc;
}
onEnterFrame=function () {
var tmc = mirror(mc,{width:120,height:106}, "mirrorMe", "h");
tmc._x = mc._x+119;
tmc._y = mc._y;
var tmc = mirror(mc,{width:120,height:106}, "mirrorMe2", "v");
tmc._x = mc._x;
tmc._y = mc._y+105;
var tmc = mirror(mc,{width:120,height:106}, "mirrorMe3", "hv");
tmc._x = mc._x+119
tmc._y = mc._y+105;
};
import flash.display.BitmapData;
import flash.geom.Matrix;
import com_zszen.spirit.create;
function mirror(mc:MovieClip,objSet:Object, newMC:String, type:String) {
var bd:BitmapData = new BitmapData(objSet.width, objSet.height, true, 0);
var tmc:MovieClip = create.Movie(mc._parent, newMC);
var bmc:MovieClip = create.Movie(tmc, "mc");
bd.draw(mc);
bmc.attachBitmap(bd, 1);
switch (type) {
case "h" :
bmc._x =objSet.width
bmc._xscale = -100;
break;
case "v" :
bmc._y = objSet.height
bmc._yscale = -100;
break;
case "hv" :
bmc._x = objSet.width
bmc._xscale = -100;
bmc._y =objSet.height
bmc._yscale = -100;
break;
case "vh" :
bmc._x =objSet.width
bmc._xscale = -100;
bmc._y =objSet.height
bmc._yscale = -100;
break;
default :
}
return tmc;
}
onEnterFrame=function () {
var tmc = mirror(mc,{width:120,height:106}, "mirrorMe", "h");
tmc._x = mc._x+119;
tmc._y = mc._y;
var tmc = mirror(mc,{width:120,height:106}, "mirrorMe2", "v");
tmc._x = mc._x;
tmc._y = mc._y+105;
var tmc = mirror(mc,{width:120,height:106}, "mirrorMe3", "hv");
tmc._x = mc._x+119
tmc._y = mc._y+105;
};