1 Reply Latest reply on Oct 10, 2007 11:00 PM by Gregory Lafrance

    How can i move a TitleWindow?

    Level 1
      The object "TITLEWINDOW" appears when initiating the application. This object is not a floating window.

      How can i do to move this object in my application?

      I have this code:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">
      <mx:Script>
      <![CDATA[
      private function ShowTitleWindow():void
      {
      window.visible = true;
      }

      private function HideTitleWindow():void
      {
      window.visible = false;
      }
      ]]>
      </mx:Script>

      <mx:Button x="40" y="10" label="Show TitleWindow" click="ShowTitleWindow();"/>
      <mx:TitleWindow id="window" x="40" y="40" width="250" height="200" layout="absolute" title="TitleWindow"
      showCloseButton="true" close="HideTitleWindow()">
      <mx:Text text="This is a test !!!"/>
      </mx:TitleWindow>

      </mx:Application>
        • 1. Re: How can i move a TitleWindow?
          Gregory Lafrance Level 6
          This seems to work:

          <?xml version="1.0" encoding="utf-8"?>
          <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">
          <mx:Script>
          <![CDATA[
          import mx.controls.Text;
          import mx.managers.PopUpManager;
          import mx.containers.TitleWindow;
          import mx.events.CloseEvent;

          private var _window:TitleWindow;

          private function ShowTitleWindow(event:MouseEvent):void
          {
          if(_window){
          return;
          }
          var txt:Text = new Text();
          txt.text = "This is a test !!!";

          _window = TitleWindow(PopUpManager.createPopUp(this,TitleWindow));
          _window.addEventListener(CloseEvent.CLOSE,HideTitleWindow);
          _window.showCloseButton = true;
          _window.x=40;
          _window.y=40;
          _window.width=250;
          _window.height=200;
          _window.title = "TitleWindow";
          _window.layout="absolute";
          _window.addChild(txt);
          }

          private function HideTitleWindow(event:CloseEvent):void
          {
          _window.visible = false;
          _window = null;
          }
          ]]>
          </mx:Script>

          <mx:Button x="40" y="10" label="Show TitleWindow" click="ShowTitleWindow(event);"/>
          </mx:Application>