在flash中,图形的位置假如不是整数,那么图形就会模糊掉(只在液晶显示器上看到)。我提供一个解决方法:
//
import flash.display.Shape;
var mc:Shape = new Shape();
addChild(mc);
mc.x = 100;
drawmc(mc);
setInterval(f,100)
function f()
{
mc.x+=.5;
}
var mc1:Shape = new Shape();
addChild(mc1);
mc1.x = 10;
var mc2:Shape = new Shape();
addChild(mc2);
mc2.x = 30.5;
drawmc(mc1);
drawmc(mc2);
//
function drawmc(mc)
{
mc.graphics.beginFill(0);
mc.graphics.drawRect(0,0,10,100);
}
动画效果: