Note that there are some explanatory texts on larger screens.

plurals
  1. POJSFL export "guides" animations
    text
    copied!<p>I need to convert timeline animations in a FLA into AS3 code (through XML, probably). The problem is that there are literally hundreds of layers and thousands of frames. </p> <p>Though I understand JSFL's structure, I am cannot find the "guides" animations by looping down into the timeline->layer->frame. Using curFrame.isMotionObject() is always false. </p> <p>Here is a sample of what I am trying to do:</p> <pre><code>/* Gets all motions in all motion objects and exports to a file. */ fl.outputPanel.clear(); //store max layers/frames var fcnt = fl.getDocumentDOM().getTimeline().frameCount; var lcnt = fl.getDocumentDOM().getTimeline().layerCount; fl.trace( "fl.getDocumentDOM().getTimeline().frameCount = " + fcnt ); fl.trace( "fl.getDocumentDOM().getTimeline().layerCount = " + lcnt ); //store pre-run layers/frames: var origFr = fl.getDocumentDOM().getTimeline().currentFrame; var origLyr = fl.getDocumentDOM().getTimeline().currentLayer; fl.trace( "fl.getDocumentDOM().getTimeline().currentFrame = " + origFr ); fl.trace( "fl.getDocumentDOM().getTimeline().currentLayer = " + origLyr ); var totout = 0; var curFrm; var curl = origLyr; var curf = origFr; var outstr = ""; for (curf = 0; curf &lt; fcnt; curf++) { // have the IDE go into the current frame: fl.getDocumentDOM().getTimeline().currentFrame = curf; // removed to test one layer only //for (curl = 0; curl &lt; lcnt; curl = lcnt) // curl++) // curl = lcnt) //{ // have the IDE go into the current layer: fl.getDocumentDOM().getTimeline().currentLayer = curl; if(curf &gt; fl.getDocumentDOM().getTimeline().layers[curl].frames.length) break; curFrm = fl.getDocumentDOM().getTimeline().layers[curl].frames[curf]; //this is always false. . . why? if ( curFrm.isMotionObject() //&amp;&amp; curFrm.hasMotionPath() ){ totout++; //curFrm.selectMotionPath(true); } else{ outstr += "There is no motion path\n"; } //for testing: break; //} //for testing: //break; } //reset layers/frames back to pre-run status: fl.getDocumentDOM().getTimeline().currentFrame = origFr; fl.getDocumentDOM().getTimeline().currentLayer = origLyr; fl.trace(outstr); fl.trace("totout = " + totout); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload