Using Simple JSFL to Reduce Tediousness of Manual Timeline Tweening

Someone over on the TechSmith forums was complaining about the tedious nature of timeline tweening in Flash, so whipped up a very simple<a href=”http://www.adobe.com/devnet/flash/articles/invisible_button.html”> jsfl</a> script that can be utilized to reduce some of the repetitive mouse interactions necessary. The following script will create a motion tween for a symbol based on the selected number of frames.

var doc = fl.getDocumentDOM();
var tl = doc.getTimeline();
var trace = fl.outputPanel.trace;

var currentLayer = tl.currentLayer;
var numberFrames = tl.layers[currentLayer].frames.length;
var actionsLayer = null;

var sel = tl.getSelectedFrames();
var lastKeyframe;
var frameArr = tl.layers[sel[0]].frames;

var flen = frameArr.length;
for ( var i = 0; i < flen; i++ )
{
if ( i == frameArr[i].startFrame )
{
lastKeyframe = i;
}
}

This code would be saved in a file with the .jsfl extension and you would obviously use the “Commands” menu of Flash MX 2004 / 8 to execute it.

I also put together a quick and dirty screencast that illustrates how to take advantage of the jsfl script inside of the Flash IDE.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*