/**
* VERSION: 1.22
* DATE: 10/2/2009
* AS2
* UPDATES AND DOCUMENTATION AT: http://www.TweenMax.com
**/
import com.greensock.*;
import com.greensock.plugins.*;
/**
* Identical to bezier except that instead of defining bezier control point values, you
* define points through which the bezier values should move. This can be more intuitive
* than using control points. Simply pass as many objects in the bezier Array as you'd like,
* one for each point through which the values should travel. For example, if you want the
* curved motion path to travel through the coordinates _x:250, _y:100 and _x:50, _y:200 and then
* end up at 500, 100, you'd do:
*
* TweenLite.to(mc, 2, {bezierThrough:[{_x:250, _y:100}, {_x:50, _y:200}, {_x:500, _y:200}]});
*
* Keep in mind that you can bezierThrough tween ANY properties, not just _x/_y.
*
* Also, if you'd like to rotate the target in the direction of the bezier path,
* use the orientToBezier
special property. In order to alter a rotation property accurately,
* TweenLite/Max needs 5 pieces of information:
*
"_x"
)"_y"
)"_rotation"
)[["_x", "_y", "_rotation", 0, 0.01]]
.
* Hint: Don't forget the container Array (notice the double outer brackets)
* import com.greensock.TweenLite;
* import com.greensock.plugins.TweenPlugin;
* import com.greensock.plugins.BezierThroughPlugin;
* TweenPlugin.activate([BezierThroughPlugin]); //activation is permanent in the SWF, so this line only needs to be run once.
*
* TweenLite.to(mc, 2, {bezierThrough:[{_x:250, _y:100}, {_x:50, _y:200}, {_x:500, _y:200}]});
*
*
* Copyright 2011, GreenSock. All rights reserved. This work is subject to the terms in http://www.greensock.com/terms_of_use.html or for corporate Club GreenSock members, the software agreement that was issued with the corporate membership.
*
* @author Jack Doyle, jack@greensock.com
*/
class com.greensock.plugins.BezierThroughPlugin extends BezierPlugin {
/** @private **/
public static var API:Number = 1.0; //If the API/Framework for plugins changes in the future, this number helps determine compatibility
/** @private **/
public function BezierThroughPlugin() {
super();
this.propName = "bezierThrough"; //name of the special property that the plugin should intercept/manage
}
/** @private **/
public function onInitTween(target:Object, value:Object, tween:TweenLite):Boolean {
if (!(value instanceof Array)) {
return false;
}
init(tween, [value][0], true); // [value][0] instead of simply value to avoid compiler error
return true;
}
}