0 Replies Latest reply on Jan 24, 2010 10:44 PM by wil_asp

    Javascript API bug ? Cannot get symbolInstance.colorAlphaPercent value for a given frame ?

    wil_asp

      Hello,

       

      My company needs me to write an export plug-in for Flash scenes.
      When the following values are animated via a Motion Tween, it is possible to set them for a given frame via a JSFL script, but not to get them. The only value we can get is only for the first frame :
      - "colorAlphaPercent"
      - "colorRedPercent"
      - "colorBluePercent"
      - "colorGreenPercent"
      - "colorAlphaAmount"
      - "colorRedAmount"
      - "colorBlueAmount"
      - "colorGreenAmount"
      I need to get the values for all the frames of the animation, how can I do it ? Please notice that the values "x" and "y", who can also be animated via a motion tween, can correctly be obtained through the Javascript API.

       

      Here is a sample script illustrating the problem (please check .fla scene in attached .zip, and launch the script from the "command" menu. Results appear in the output panel) :

       

       

      fl.outputPanel.clear();
      fl.getDocumentDOM().exitEditMode();
      fl.getDocumentDOM().getTimeline().currentLayer = 0;

      fl.getDocumentDOM().getTimeline().currentFrame =0;
      fl.getDocumentDOM().selectNone();
      fl.getDocumentDOM().getTimeline().layers[0].frames[0].elements[0].selected = true;
      fl.trace(
          "frame="+fl.getDocumentDOM().getTimeline().currentFrame + "\r" +
          "R=" + fl.getDocumentDOM().getTimeline().layers[0].frames[0].elements[0].colorRedAmount   + "\r" +
          "G=" + fl.getDocumentDOM().getTimeline().layers[0].frames[0].elements[0].colorGreenAmount + "\r" +
          "B=" + fl.getDocumentDOM().getTimeline().layers[0].frames[0].elements[0].colorBlueAmount  + "\r" +
          "A=" + fl.getDocumentDOM().getTimeline().layers[0].frames[0].elements[0].colorAlphaAmount + "\r" +
          "X=" + fl.getDocumentDOM().getTimeline().layers[0].frames[0].elements[0].x + "\r" +
          "Y=" + fl.getDocumentDOM().getTimeline().layers[0].frames[0].elements[0].y + "\r" );

      fl.getDocumentDOM().getTimeline().currentFrame =49;
      fl.getDocumentDOM().selectNone();
      fl.getDocumentDOM().getTimeline().layers[0].frames[49].elements[0].selected = true;
      fl.trace(
          "frame="+fl.getDocumentDOM().getTimeline().currentFrame + "\r" +
          "R=" + fl.getDocumentDOM().getTimeline().layers[0].frames[49].elements[0].colorRedAmount   + "\r" +
          "G=" + fl.getDocumentDOM().getTimeline().layers[0].frames[49].elements[0].colorGreenAmount + "\r" +
          "B=" + fl.getDocumentDOM().getTimeline().layers[0].frames[49].elements[0].colorBlueAmount  + "\r" +
          "A=" + fl.getDocumentDOM().getTimeline().layers[0].frames[49].elements[0].colorAlphaAmount + "\r" +
          "X=" + fl.getDocumentDOM().getTimeline().layers[0].frames[49].elements[0].x + "\r" +
          "Y=" + fl.getDocumentDOM().getTimeline().layers[0].frames[49].elements[0].y + "\r" );
         
      fl.trace("We can get the new value of Y, but not the new value of colorAlphaAmount !");

       


      Any help would be deeply appreciated !