our animator created a very complex movieclip in Adobe Flash CS5, containing 50+ layers, motion tweens and 3D tweens. Unfortunately, she placed all elements 680 pixels too far to the right and 400 pixels too far down.
We're trying to find a way to move all elements on all layers without breaking the animations. We tried a JSFL script called "MoveRegpoint", but it does not handle the Motion Tween keyframes (diamonds) properly. So now I am trying to write a JSFL myself.
How can I determine if a frame is a Motion Tween and if the frame is a keyframe? See the current script:
// get the selected Element
var vElement = fl.getDocumentDOM().selection[0];
// get the Timeline of the Element
var vTimeline = vElement.libraryItem.timeline;
// loop over the Timeline's Layers
var vLayersLength = vTimeline.layers.length;
for (var i=0; i<vLayersLength; ++i) {
var vLayer = vTimeline.layers[i];
// loop over each Layer's Frames
var vFramesLength = vLayer.frames.length;
for (var j=0; j<vFramesLength; ++j) {
var vFrame = vLayer.frames[j];
if(vFrame.isMotionObject()) {
// DOES NOT WORK, startFrame is always 0
if(vFrame.startFrame == j) {}
}
}
}
To be clear: frame.startFrame is always 0 because the Motion Tween starts at frame 0. There are diamonds at frame 12, 27 and 49 that define the motion. I want to know if a frame contains a diamond and access the data in these diamonds.
Paul