0 Replies Latest reply on Mar 24, 2011 8:05 AM by cameronmcefee

    Script breaks somewhere between Flex and CSXS

    cameronmcefee Level 1

      Hello,

       

      I'm sorry if this isn't the right place to put this. At the moment, I'm not sure at which stage in the process my script is having issues, so it may be a Flex thing.

       

      I'm running into errors when using my custom photoshop panel that don't appear to be related to my script itself. I've been building this panel with trial copies of Flash Builder 4 on various machines and it seems that something breaks each time I have to set up my environment again. On the previous machine, it was compiling fine and worked in both CS4 and CS5. On this newest setup, I get the following output in the Air Logger in CS5:

       

      3/9/2011 07:50:16.600 [DEBUG] com.adobe.csxs.external.CommunicationUtils [DispatchingRequest functionName="findMiddleSuspender" params="true|true"]
      ------------------
      3/9/2011 07:50:16.600 [ERROR] com.adobe.csxs.external.CommunicationUtils [Error in request data, it is null where some data is expected ]
      ------------------
      3/9/2011 07:50:16.601 [INFO] com.adobe.csxs.external.CommunicationUtils [RequestResult after parsing result="[RequestResult status="RequestResultInvalid" data=null]" ]
      ------------------
      3/9/2011 07:50:16.602 [DEBUG] com.adobe.csxs.external.CommunicationUtils [Result="[RequestResult status="RequestResultInvalid" data=null]"]
      ------------------

       

      I can't find any documentation on external.CommunicationUtils, so I'm not sure at what point the error is being thrown.

       

      The function call (mxml):

       

      private function findMiddle_StageBoth(event:Event):void {
         CSXSInterface.instance.evalScript("findMiddleSuspender", "true|true");
      }

       

      The function (jsx):
      function findMiddleSuspender (a) {
         app.activeDocument.suspendHistory("Find Middle", "findMiddle(a)");
         // All the parameter parsing happens in the next function. I left this in here for reference, but even something as simple as alert(a) throws the error. I'm not sure where that means the script is having problems.
      }

       

      In an attempt to try to figure out where the error is actually happening, I stripped the functions down to bare bones:

       

      (mxml):

      private function findMiddle_StageBoth(event:Event):void {
         CSXSInterface.instance.evalScript("findMiddleSuspender");
      }

       

      (jsx):

      function findMiddleSuspender () {
         alert('Foo')
      }

       

      and it still gave me the "some data is expected" error, which leads me to believe it's not my functions that are the problem, as they require no data.


      My current setup:
      • Flash Builder 4
      • SDK: CS Flex SDK 3.4.0 (Also tried Flex 3.5 and Flex 4)
      • Libs: CSXSLibrary.swc (Don't recall where I got it. CSXSLibrary-2.0-sdk-3.4-public.swc that comes with the SDK and Panel Dev Guide both cause errors with the Air Logger)