Jump to content
Search Community

nokiaddt

Members
  • Posts

    4
  • Joined

  • Last visited

nokiaddt's Achievements

0

Reputation

  1. I try to execute the code by my home computer using Flash Builder 4. And I got the same result. The executable code is ... Main.mxml <?xml version="1.0" encoding="utf-8"?> xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx"> home.nokiddt.BezierThrough.as package home.nokiaddt { import com.greensock.TweenMax; import com.greensock.data.TweenMaxVars; public class BezierThrough { public function BezierThrough() { } 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]; } moveItVars.bezierThrough(tmpArray) TweenMax.to(target, 5, moveItVars); } } }
  2. sorry for wrong code. actually I have that code like 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]; } moveItVars.bezierThrough(tmpArray) TweenMax.to(target, 5, moveItVars); } and hope (or not) you can find the same result like what I said.
  3. 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.
×
×
  • Create New...