3 Replies Latest reply on Sep 3, 2012 6:30 AM by benjaminmueller_burda

    New window that resizes content




      how can I open a <mx:Window> component inside photoshop with CSXSWindowType.PANEL that resizes its contents?

      I am trying to detect the windowResize event but it doesn't seem to work.


      That's the code for ExtraLayers.mxml



      <?xml version="1.0" encoding="utf-8"?>
                  public function init():void
                       trace("CSXS Window init");
                  public function resizeHandler():void
             <mx:Button name="close" click="this.close()" />


      and this is how I am trying to open it:


      if (!LAYERS_PANEL) {
           LAYERS_PANEL = new ExtraLayers();
           if (LAYERS_PANEL) {
                LAYERS_PANEL.type = CSXSWindowType.PANEL; 
                LAYERS_PANEL.title = "Extra Layers"; 
                LAYERS_PANEL.width = 300;
                LAYERS_PANEL.height = 500;
                LAYERS_PANEL.resizable = true;
      if (LAYERS_PANEL) {
           LAYERS_PANEL.addEventListener(Event.CLOSE, function():void { LAYERS_PANEL = null;});
        • 1. Re: New window that resizes content



          I haven't done any Photoshop Plug-In Development but "some" for InDesign.  I still do not understand what you try to achive? Other than that you have a "Syntax Error" in your code



          LAYERS_PANEL.addEventListener(Event.CLOSE, function():void { LAYERS_PANEL = null;});


          should be



          LAYERS_PANEL.addEventListener(Event.CLOSE, function() {

                                                                      LAYERS_PANEL = null;




          you do not append the "return type" like in Java/Actionscript to an Extendscript function declaration.


          Are you using FlashBuilder for this? Barebones CSSDK with an editor?


          would like to help





          • 2. Re: New window that resizes content
            jordidy Level 1

            Hi Benjamin,


            thanks for the reply.

            Sorry if the code didn't show what my problem is.

            What I am trying to accomplish is to open a new window type PANEL that resizes its content whenever the window is resized.

            The code for the opening window is the ExtraLayers.mxml and the way I am opening is the other code I pasted.


            Right now I can open the new window (ExtraLayer.mxml) but whenever I drag the corner to resize it the content stays at the same size.

            I tried firing the onResize event with no success (the handler doesn't get executed)


            Hope it's clearer now. Sorry for the confusion and thanks for your help

            • 3. Re: New window that resizes content
              benjaminmueller_burda Level 1



              maybe I am just too stupid today .. here is how I would solve it


              PStest.mxml (the panel)


              <?xml version="1.0" encoding="utf-8"?>

              <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" historyManagementEnabled="false"  applicationComplete="colorSync()" xmlns:local="*">







                          private var hostName:String = HostObject.mainExtension;


                          public function colorSync():void{







                  <local:TestWindow left="0" right="0" top="0" bottom="0">






              and your window


              TestWindow.mxml (the window in the panel)


              <?xml version="1.0" encoding="utf-8"?>

              <s:Window xmlns:fx="http://ns.adobe.com/mxml/2009"


                        xmlns:mx="library://ns.adobe.com/flex/mx" width="400" height="300">






              The size of an embedded "window" (even though Adobe doesn't recommend to use the baseclass "window") can be easily controlled via the parent Application (the panel).  When you resize the panel the window automatically gets resizes as well through "left / top / right / bottom" ..


              I hope I didn't completely misunderstand your problem.