Newer
Older
chatpod / chatpod.mxml
@reddawg reddawg on 30 Nov 2007 1 KB chatpod
<?xml version="1.0" encoding="utf-8"?>
<mx:Module xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" pageTitle="Podz Chat" paddingTop="3" creationComplete="doInit()">
  <mx:Script>
  	<![CDATA[
  	  import mx.collections.ArrayCollection;
  	  import mx.events.FlexEvent;
  	  import mx.controls.Alert;
  	    	
  	  private var myPod:Object;
  	  public var userInfo:ArrayCollection;
  	    	
	  public function doInit():void {
        doResize(null);
        myPod = this.parent.parent;
        myPod.addEventListener("resizeThisPod",doResize);
        myPod.addEventListener("closeWindow",doClose);
        myPod.setColor(0x00CCFF);
        userInfo = this.parentDocument.userInfo;
        chat.userId = userInfo[0].username;
        chat.initComp();
        chat.requestUsers();
        } /* End doInit(); */
      public function doResize(event:FlexEvent):void {
        this.width = this.parent.width;
        this.height = this.parent.height;
        } /* End doResize(); */

      public function doClose(event:FlexEvent):void {
    	chat.sendDepart();
        myPod.removeEventListener("resizeThisPod",doResize);
        myPod.removeEventListener("closeWindow",doClose);
        } /* End doClose(); */
  	]]>
  </mx:Script>
  <mx:Canvas width="100%" height="100%">
  <Chat id="chat" width="100%" height="100%" />  	
  </mx:Canvas>

</mx:Module>