I'm writing a jsfl script to export animations in Flash CS6 to a format we desired. Here's the problem, as we used motion tween for animation, we can correctly get position, rotation and scale of the element using the following code. However the code cannot work with color information:
var element = something;
for( var frameIndex = 0; frameIndex < layer.frames.length; frameIndex++ )
{
timeline.currentFrame = frameIndex;
fl.trace( element.x + ", " + element.y ); // Works
fl.trace( element.scaleX + ", " + element.scaleY ); // Works
fl.trace( element.rotation ); // Works
fl.trace( element.colorAlphaPercent ); // DOES NOT WORK
}
We did a simple animation that the element's alpha changes from 0 to 100, linear. As we print out all the colorAlphaPercent
value from start to end, turns out that it's all 0. We tested more and discovered that no matter what animation you make, on any frame, the colorAlphaPercent
value always equals the value on the first frame. The same thing happens on colorAlphaAmount
and other color values (red, green, blue).
The only way we can get rid of this is to do the Convert to frame by frame animation
on the motion tween. But that break up one element into many of them, so that I can't tell if they are originally the same element.
So... is there anyone know how to get the color information from an element within a motion tween? Thanks anyway :)