ActionScript 3 Tweener例子

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ActionScript 3 Tweener例子相关的知识,希望对你有一定的参考价值。

//Simple Tween
Tweener.addTween(myTextField, {_y:200, time:0.7, transition:"linear"});


// Using events to fade out then disappear (anonymous in-line function)
Tweener.addTween(myMovieClip, {alpha:0, time:1, onComplete:function() { this._visible = false; }});


// Using events to fade out then disappear (using the _autoAlpha special property)
Tweener.addTween(myMovieClip, {_autoAlpha:0, time:1});


// Complex Tweening
fGo = function() { trace ("I'll go!"); };
fGoing = function() { trace ("I'm going!"); };
fGone = function() { trace ("I'm gone!"); };
Tweener.addTween(myMovieClip, {alpha:0, time:1, onStart:fGo, onUpdate:fGoing, onComplete:fGone});


// Using other special properties (that are not related to a variable/property)
Tweener.addTween(mySoundObject, {_sound_volume:100, time:1});
Tweener.addTween(myMovieClip, {_frame:10, time:2.5});


// Using tweener 'templates'
var fadeIn:Object = {alpha:100, time:1};
Tweener.addTween(myMovieClip, fadeIn);

以上是关于ActionScript 3 Tweener例子的主要内容,如果未能解决你的问题,请参考以下文章

ActionScript 3 使用Tweener补间数字

ActionScript 3 使用Tweener绘制和动画圆圈

[ActionScript 3.0] 幻灯片效果实例

ActionScript 3 AS3 ComboBox极其基本的例子

ActionScript 3 AS3:我最喜欢的Singleton的例子

Tweener的Tweening数