Groups | Blog | Home
all groups > flash exchange extensions > november 2005 >

flash exchange extensions : Keyframes and JSFL


robotstyle
11/4/2005 12:00:00 AM
Inserting multiple keyframes within a motion tween with a jsfl command has an
undesirable effect. Why, and how can I fix this? A demonstration file can be
found here:

http://www.geocities.com/MichaelGioffredi/InsertKeyframeTest.zip

Install the mxp file, then open the sample fla to see what I mean.

I have a fairly large project that is dependent on this working correctly, so
it could mean the difference between a very cool effect, or many hours of
wasted work. Thanks.
robotstyle
11/5/2005 12:00:00 AM
This way works:

//Insert keyframe test

var getDoc = fl.getDocumentDOM();
var timeline = getDoc.getTimeline();

var startFrame = 4;
var endFrame = 14;

for (i=0; i<=1; i++)
{
timeline.currentLayer = i;
timeline.convertToKeyframes(startFrame, endFrame);
timeline.clearKeyframes(startFrame+1, endFrame-1);
}

Although I would prefer the first way.

AddThis Social Bookmark Button