11/05/2011

as3 常用左右偏宜code&模擬pv3d的plane

//使用ENTER_FRAME
addEventListener(Event.ENTER_FRAME, pic_enterframe);

function pic_enterframe(e:Event):void
{
//模擬pv3d的紙片效果
//mc.rotationY += (0-this.mouseX/20-mc.rotationY+20)/10;
//mc.rotationX += (0-this.mouseY/20-mc.rotationX+0)/10;
//一般常用的左右偏宜obj
mc.x += (275-this.mouseX/20-mc.x)/20;
}

No comments:

Post a Comment