package{ import flash.display.*; import flash.events.*; public class Veetilk1 extends Sprite{ public var maht:Number=1000; //kuupmillimeetrit public var r:Number=10, dx:Number=5, dy:Number=-1, kiirus:Number=5; public function Veetilk1(){ joonista(); y=100; addEventListener(Event.ENTER_FRAME, liigu) } public function joonista():void{ rotation=Math.atan2(dy, dx)*180/Math.PI-90; kiirus=Math.sqrt(dx*dx+dy*dy); graphics.clear(); graphics.lineStyle(1, 0, 1); r=Math.pow(maht, 0.33); graphics.beginFill(0X0000FF); graphics.moveTo(-r, 0); //graphics.cubicCurveTo(-r, r, r, r, r, 0); graphics.curveTo(0, 2*r/(1+kiirus/5), r, 0); graphics.curveTo(0, -2*r*(1+kiirus/5), -r, 0); graphics.endFill(); } public function liigu(e:Event):void{ x+=dx; y+=dy; } } }