Saturday, November 13, 2010

Bezier Tween in ActionScript 3

Flex Builder 4 Flash Video Flash Video

TweenMax also introduces an innovative feature called "bezierThrough" that allows you to define points through which you want the bezier curve to travel. Use the code below and alter the bezierThrough values, adding more or less values.

import gs.TweenMax;
import fl.motion.easing.*
TweenMax.to(mc, 3, {x:344, y:351, bezierThrough:[{x:78.2, y:198.15}, {x:260.05, y:93.75}, {x:348.8, y:123.3}], ease:Bounce.easeOut});

Click on the ball to start the tween


  • x:344, y:351 (The tween x & y values)
  • x:78.2, y:198.15 (1st Bezier point)
  • x:260.05, y:93.75 (2nd Bezier point)
  • x:348.8, y:123.3 (3rd Bezier point)

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...