package{ import flash.display.*; import flash.events.*; import flash.ui.Keyboard; public class KeeratavRuut extends Sprite{ private var ruut:Sprite=new Sprite(); public function KeeratavRuut(){ ruut.graphics.beginFill(0x00FF00); ruut.graphics.drawRect(-25, -25, 50, 50); addChild(ruut); stage.addEventListener(KeyboardEvent.KEY_DOWN, liigu) } public function liigu(e:KeyboardEvent):void{ if(e.keyCode==Keyboard.LEFT) ruut.rotation--; if(e.keyCode==Keyboard.RIGHT) ruut.rotation++; } } }