Need help!

Hi… I am new to this forum… and trying to learn as3… jus started off with learning as3 pdf(from adobe)… and tried to build one simple program to add two numbers and get the result in a dynamic textfield… I don’t know if what I did is correct or not but its still giving me the right result so I guess I am on the right track…code n snapshot is there… please feel free to correct me if I’m getting the whole thing in a wrong way… so far its working fine… but now what I want is that, right after running the application, it should promt a text in the dynamic field saying “enter the numbers and then press enter key” and then rest of the thing has to be same as before. problem is how to get text in mainText textfield( as I’ve declared ans as number)… I would appreciate if someone can help me out with this…

 
function dosum(firstN:Number, second:Number):Number {
 var firstN:Number;
 var second:Number;
 var ans:Number = firstN + second;
 //trace(ans);
 return ans;
}
 
firstTxt.border=true;
secTxt.border=true;
mainText.border=true;
 
firstTxt.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
secTxt.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
function keyPressed(event:KeyboardEvent):void {
 if (event.keyCode == Keyboard.ENTER) {
  var firstNum:Number;
  var secondNum:Number;
  firstNum=Number(firstTxt.text);
  secondNum=Number(secTxt.text);
  var output:Number= dosum(firstNum, secondNum);
  mainText.text= output.toString();
  //trace(firstNum);
  //trace(secondNum);
  //trace(output);
  //trace(mainText.text);
 }
}