2 Replies Latest reply on Jan 31, 2013 4:23 AM by Harbs.

    Crash when opening windows in extension...

    geis02

      Hello everybody.

       

      I have encountered a strange issue when trying to open a window from within my extension on OSX: It seems that whenever i try to open a "spark" window from Photoshop CS6, it instantly crashes. The same extension works flawlessly in InDesign.

      I have tested it on OSX v. 10.7.5 and 10.8.2 - I haven't tested on Windows, so I don't know if it's a Mac only issue.

       

      I have tried to compile a minimal test case to illustrate the problem - using Extension Builder (2.0.0.62-32314) I created a new project targeting Photoshop and InDesign CS6. I have pasted the contents of the extension and a simple window below.

      Now - when i execute this in InDesign,  the window opens and displays fine when I click the "Open window"-button - but executing it in Photoshop causes a crash. If don't set the window type, I can debug and see a different kind of error (Error #3200: Cannot perform operation on closed window) and still no window is shown. And again: only in Photoshop...

       

      So: Have I run into a bug introduced in the latest versions of PS/Extension Builder? I'm pretty sure this used to work in earlier versions (with mx:Window rather than s:Window)? Or is there any other way to open these kinds of native windows, that Photoshop might be happier about?

       

      Thanks.

       

      -- Gerth Isaksen

       

      ---

       

      The main extension file:

       

      <csxs:CSExtension xmlns:fx="http://ns.adobe.com/mxml/2009"

                        xmlns:s="library://ns.adobe.com/flex/spark"

                        xmlns:csxs="com.adobe.csxs.core.*">

          <fx:Script>

              <![CDATA[

                  import com.adobe.csxs.types.CSXSWindowType;

                  protected function onClick(event:MouseEvent):void{

                      var w:TestWindow = new TestWindow();

                      w.type = CSXSWindowType.MODAL_DIALOG;

                      w.open();

                  }

              ]]>

          </fx:Script>

          <s:VGroup height="100%" width="100%" verticalAlign="middle" horizontalAlign="center">

              <s:Button label="Open window" click="onClick(event)" />

          </s:VGroup>           

      </csxs:CSExtension>

       

      And a rather simple window, TestWindow.mxml, I want to open:

       

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

                xmlns:s="library://ns.adobe.com/flex/spark">

          <fx:Script>

              <![CDATA[

                  import mx.events.FlexEvent;

       

                  protected function button1_clickHandler(event:MouseEvent):void{

                      close();

                  }

              ]]>

          </fx:Script>

          <s:VGroup width="100%" height="100%" horizontalAlign="center">

              <s:Label text="Hello" width="100%" height="100%"/>

              <s:Button label="Close me!" click="button1_clickHandler(event)"/>

          </s:VGroup>

      </s:Window>