/ Published in: ActionScript 3
Simple Tweener Examples
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
//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);
URL: http://hosted.zeh.com.br/tweener/docs/en-us/