Class with a bezierThrough function
package home.here {
import com.greensock.TweenMax;
import com.greensock.data.TweenMaxVars;
public class MyClass{
public function MyClass() {}
public function bezierThrough (target:Object, toXY:String):void {
var xyArray:Array = toXY.split(",");
var tmpArray:Array = new Array(xyArray.length / 2);
var moveItVars:TweenMaxVars = new TweenMaxVars();
for(var i:int = 0; i < xyArray.length / 2; i ++) {
tmpArray[i] = new Object();
tmpArray[i].x = xyArray[i * 2];
tmpArray[i].y = xyArray[i * 2 + 1];
}
TweenMax.to(target, 5, moveItVars);
}
}
main mxml with an image which location is (70,300)
<?xml version="1.0" encoding="utf-8"?>
The motion of image should be start from (70,300) -> (130,0) -> (330,300), but the result is (70,300) -> (200,300) -> (400,600).
Can you tell me where the problem is?
Thanks a lot.