[转]跟随鼠标带弹性的旋转风车
var aa:Sprite=new aac()addChild(aa)var vx:Number=0var vy:Number=0var fr:Number=0.99var d:Number=15var f:Number=5var i:Number=1var k:Number=0.01addEventListener(Event.ENTER_FRAME,ss)function ss(e:Event):void{ aa.rotation=i vx+=(mouseX-aa.x)*0.01 vy+=(mouseY-aa.y)*0.01 vx*=fr vy*=fr aa.x+=vx aa.y+=vy aa.scaleX+=k aa.scaleY+=k i-=d; if(i<=-360){ i=15} if(aa.scaleX>7){ k=-k }else if(aa.scaleX<1){ k=-k } graphics.clear() graphics.lineStyle(0.5,0xff0000) graphics.moveTo(mouseX,mouseY) graphics.lineTo(aa.x,aa.y) }