ITeye博客

取caurina 舍gs --TweenLite

ttk512tw · 2012-01-20 01:48 · 技术杂绘 · 非技术 · Markdown

取caurina 舍gs --TweenLite 2010年07月24日   今天重新去了一下 gs 网站!发现好像TweenLite不是免费类库了! 商业用途需要收费!   所以只好用caurina
  在国外, caurina 商业应用最广泛!主要得益于它的licese 是免费的 !可用于商业开发:   下面是caurina的用法 和TwenLite类似!:   教程网站:   http://www.flepstudio.org/forum/tutorials/1553-cau rina-tweener-zeh-fernando-tutorial-1-a.html   http://www.flashuser.net/flash-actionscript-as3/us ing-caurina-tweener-class-as3.html   以及关于bezier的用法 : 注意 _bezier _color 的写法前面有一下划线   _bezier的值是一数组 Array   下面是摘自老外的tutorial   Lets say you want to use Tweener to animate a camera in your PV3D Scene from z:0 to z:1400... but you want it to animate along a path with smooth bezier curves. Piece of cake! Here is how you do it.   Example (don't freak, there's a lot more comments than there is code):   //first you will need to import your Tweener classes   //in this case, also import the CurveModifiers class   import caurina.transitions.Tweener;   import caurina.transitions.properties.CurveModifiers;   //instantiate the CurveModifiers   CurveModifiers.init();   //create an Array that will hold the various bezier curve points   //the values indicate the that camera will swing from the left to the right   var curvePath:Array = new Array();   curvePath.push({x:400});   curvePath.push({x:-400});   curvePath.push({x:400});   curvePath.push({x:-400});   //you could also add in additional bezier curve point paramerts   //such as curvePath.push({x:400, y:200, z:200});   //set up a function to set the default position of the camera   //and to instantiate a tweener animation   //note that there is an additional parameter "_bezier" in the Tweener parameters   //in the "_bezier" parameter we passed in our curvePath array   function startTween():void   {   camera.z = -200;   Tweener.addTween(camera, {   x:0,   z:1400,   _bezier:curvePath,
  time:12,   transition:"linear",   onComplete:startTween});   }   //lastly, call the startTween function to fire it off   //since the Tweener function has an onComplete parameter   //of startTween the animation will loop continuously   startTween();   _bezier的值是一个数组:

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。