I have an app made in flash where the user inputs text, the text is then transferred to a seperate text box, and then it is saved on the users machine. This works fine, I'm just hoping to add one bit of functionality. I would like the flash to recognize when the user has hit the return key (it is going to be an air application, so the return key on the soft keyboard) and then insert line breaks in the text field. This is important since as of now the text file gets saved with no line breaks at all, another words one long string of text. How about an event listener if the key code is return, enter a line break in the new text field? just not sure how to do that. My code so far:
var inputField3:TextField = new TextField();
var tf3:TextFormat = new TextFormat;
tf3.font = "arial";
tf3.size = 18;
tf3.leading =4;

inputField3.defaultTextFormat = tf3;
inputField3.border = true;
inputField3.width = 306;
inputField3.height = 392;
inputField3.x = 9;
inputField3.y = 10;
inputField3.type = "input";
inputField3.multiline = true;

savebtn.addEventListener(MouseEvent.CLICK, fileSaver3);

function captureText3():void
inputField3.addEventListener(TextEvent.TEXT_INPUT, inputEventCapture3);

function inputEventCapture3(event:TextEvent):void
var narrative:String = inputField3.text;


function createOutputBox3(str:String):void

OutputBox3.background = true;
OutputBox3.x = 44;
OutputBox3.text = str;
OutputBox3.visible = false;

function fileSaver3(event:MouseEvent):void
{trace (OutputBox3.text);
var file:FileReference = new FileReference();
file.save(OutputBox3.text, "narrative.txt");
homeybtn.addEventListener(MouseEvent.CLICK, gohome9);
function gohome9(event:MouseEvent):void
if (inputField3 != null && this.contains(inputField3))
trace("new remove");
trace("input field null");


Thanks for your help.