1 Reply Latest reply on Jun 6, 2008 10:42 PM by Gregory Lafrance

    simple chat


      I am new to Flex. I figure it should be relatively easy to create a simple chat. I just want a textarea, text input and submit button. I have figured out how to bind a text input to textarea. I just want to know how enter text click submit and have it show in the textarea.


        • 1. Re: simple chat
          Gregory Lafrance Level 6
          Probably don't want to bind TextArea to TextInput text as you want user to be able to choose when to submit. Binding will have text in TextInput immediately appear in TextArea as you are typing. Try this:

          <?xml version="1.0"?>
          <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml">
          private function clickHandler():void{
          txtArea.text += "\n" + txtInput.text;
          txtInput.text = "";
          <mx:TextInput id="txtInput" width="800"/>
          <mx:TextArea id="txtArea" width="800" height="600"/>
          <mx:Button label="Submit" click="clickHandler()"/>