1 Reply Latest reply on May 10, 2016 10:22 AM by Preran

    Adapt Useful JSFL Scripts for Animate/Canvas

    moccamaximum Level 5

      As a programmer who likes automating a lot I have used/made a lot of jsfl scripts for Flash in the past.

      Some new users might not know that these scripts can be easily adapted for Javascript/Canvas.

       

      For Example:

       

      With a timeline selected try this:

       

      /*

      * [KC] Add Stop Frames

      * By Kevin Cao(http://kevincao.com)

      * 2005.6.19

      */

       

      // inserts keyframes with a stop Command in every frame of the selection

       

      var dom=fl.getDocumentDOM()

      var timeline=dom.getTimeline()

      var selections=timeline.getSelectedFrames()

      var numSelections=selections.length

      for(s=0;s<numSelections;s+=3)

      {

          cLayer=selections[s]

          startFrame=selections[s+1]

          endFrame=selections[s+2]

          timeline.setSelectedFrames([cLayer,startFrame,endFrame],true);

          timeline.convertToKeyframes();

          for(f=startFrame;f<endFrame;++f)

          {

              timeline.layers[cLayer].frames[f].actionScript="this.stop();";

          }

      }

       

      JSFL doesn`t care if you use "real" actionScript.

       

      Thought that might be helpful.