package { import flash.display.*; import flash.events.*; import mx.core.UIComponent; import mx.controls.Alert; public class Automobiil extends Sprite { protected var rattad:Array=new Array() protected var kere:Sprite=new Sprite(); private var rattanurk:Number=0; public var nurgamuutus:Number=1; public var rattaRaadius:int; public function Automobiil(rr:int){ rattaRaadius=rr; alustus(); addEventListener(Event.ENTER_FRAME, liigu); addChild(kere); } protected function alustus():void{ rattad[0]=new Ratas(rattaRaadius); rattad[1]=new Ratas(rattaRaadius); var g:Graphics=kere.graphics; g.lineStyle(15, 0X000000); g.moveTo(80, 0); g.lineTo(120, 0); g.endFill(); addChild(rattad[0]); addChild(rattad[1]); rattad[1].x=200; } private function liigu(e:Event):void{ rattanurk+=nurgamuutus; x+=nurgamuutus; for(var i:Number=0; i