4 Replies Latest reply on Feb 6, 2011 3:56 AM by Pablo Souza

    mxml and action script


      Hello Everyone,

      how can I make panel component from spark package draggable ?


      <sx:Panel    x="118" y="89" width="564" height="234" id="addPanel" title="sss" textAlign="right" enabled="true" >



      thanks in advance ,..

        • 1. Re: mxml and action script
          Pablo Souza Level 3

          I believe you are looking for this:




          Let me know if it helps you!




          Pablo Souza

          • 2. Re: mxml and action script
            Pablo Souza Level 3

            You can also use a Spark TitleWindow instead of a Spark Panel.



            <?xml version="1.0" encoding="utf-8"?>
            <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
              <s:Button id="btn"
                        label="launch Spark TitleWindow"
                        click="btn_clickHandler(event);" />
               import mx.core.IFlexDisplayObject;
               import mx.events.CloseEvent;
               import mx.managers.PopUpManager;
               import spark.events.TitleWindowBoundsEvent;
               protected function btn_clickHandler(evt:MouseEvent):void {
                // Add and center the pop up window.
                PopUpManager.addPopUp(titleWin, this, true);
               protected function titleWin_closeHandler(evt:CloseEvent):void {
                // Remove the pop up window.
                PopUpManager.removePopUp(evt.currentTarget as IFlexDisplayObject);
              <s:TitleWindow id="titleWin"
                             title="Spark TitleWindow container"
                             creationComplete="titleWin.moveArea.visible = ch.selected;">
                <s:VerticalLayout paddingLeft="10" paddingRight="10"
                                  paddingTop="10" paddingBottom="10" />
                <s:CheckBox id="ch"
                            label="Should I be draggable?"
                            change="titleWin.moveArea.visible = ch.selected;" />
               <s:Label text="The quick brown fox jumps over the lazy dog."
                        width="100%" />





            Pablo Souza

            1 person found this helpful
            • 3. Re: mxml and action script
              KiarasH.Mozafari Level 1

              thnask a lot both of you ..

              I really need to drag Panel componet, and titleWindiws is so useful !



              • 4. Re: mxml and action script
                Pablo Souza Level 3

                Really nice!


                Best regards,

                Pablo Souza