Newer
Older
AIR-TUve / src / imWindow.mxml
@reddawg reddawg on 5 Dec 2007 1 KB *** empty log message ***
<?xml version="1.0" encoding="utf-8"?>
<tvWindow xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" layout="absolute" cornerRadius="7" title="IM" width="425" height="450">
  <mx:Script>
  <![CDATA[
  import mx.controls.Alert;
  
    public var toNick:String;
    public var tvMaster:Master;
  
    public function sendMsg():void {
      tvMaster.tvNetwork.sendData("MSG " + toNick + ":" + inputText.text + "\n");
  	  msgText.htmlText += "[" + new Date().toLocaleTimeString() + "] " + (tvMaster.userName + ": " + inputText.htmlText);
  	  inputText.htmlText = "";
      } /* End sendMsg() */
      
    private function checkEnter(event:KeyboardEvent):void {
      if ((event.keyCode == Keyboard.ENTER) && (event.shiftKey == false))
        sendMsg();
    }

  ]]>
  </mx:Script>
  <mx:VBox width="100%" height="100%">
    <mx:TextArea click="focusManager.setFocus(inputText.textArea)" mouseUp="tvMaster.setClip(msgText)" updateComplete="msgText.verticalScrollPosition = msgText.maxVerticalScrollPosition" id="msgText" width="100%" height="100%" />
    <mx:RichTextEditor id="inputText" width="100%" keyDown="checkEnter(event)"  height="35%" y="154" showControlBar="true" title="Text Input:" />
  </mx:VBox>
</tvWindow>