HI, I am currently creating a little Flash IDE animation exporter which exports a timeline animation using JSFL. Part of what i am exporting is the custom ease curve that you get in the IDE. Here is an example of what it spits out:
[{ x:0.00000, y:0.00000 },{ x:0.33333, y:0.00000 },{ x:0.66667, y:0.33333 },{ x:1.00000, y:1.00000 }]
What i am trying to do it convert this curve into a CustomEase. This is what i am currently doing:
1. First put all the x values into an array and another for the y. ( points.x and points.y )
while( i < points.length )
{
bezierPoints.x.push( points[i].x );
bezierPoints.y.push( points[i].y );
i ++;
}
2. Use BezierPlugin.parseBeziers( points, true )
var parsedBezierPoints:Object = BezierPlugin.parseBeziers( bezierPoints, true );
3. Pull out the y values from parsedBezierPoints and put them into an object of s, cp, and e
var yPoints:Array = parsedBezierPoints:Object.y
var data:Array = []
var i:int = 0;
while ( i < $points.length )
{
data[i] = { s:yPoints[i][0], cp:yPoints[i][1], e:yPoints[i][2] };
i++
}
example trace:
[{"e":0,"s":0,"cp":-0.08325},{"e":0.333,"s":0,"cp":0},{"e":1,"s":0.333,"cp":0}]
4. Create the custom ease using the new data
CustomEase.create( "DIGEase", data );
For some reason i keep getting a gitter and not a smooth ease on the animation. Can anyone see if im doing something wrong or point me in a right direction.
Thanks in advance.