var b:Number = 30; Key.addListener(this); function onKeyDown():Void { if (Key.isDown(Key.ENTER)) tf2.text = parseInt(tf1.text) + b; }