Tweener Examples


/ Published in: ActionScript 3
Save to your folder(s)

Simple Tweener Examples


Copy this code and paste it in your HTML
  1. //Simple Tween
  2. Tweener.addTween(myTextField, {_y:200, time:0.7, transition:"linear"});
  3.  
  4.  
  5. // Using events to fade out then disappear (anonymous in-line function)
  6. Tweener.addTween(myMovieClip, {alpha:0, time:1, onComplete:function() { this._visible = false; }});
  7.  
  8.  
  9. // Using events to fade out then disappear (using the _autoAlpha special property)
  10. Tweener.addTween(myMovieClip, {_autoAlpha:0, time:1});
  11.  
  12.  
  13. // Complex Tweening
  14. fGo = function() { trace ("I'll go!"); };
  15. fGoing = function() { trace ("I'm going!"); };
  16. fGone = function() { trace ("I'm gone!"); };
  17. Tweener.addTween(myMovieClip, {alpha:0, time:1, onStart:fGo, onUpdate:fGoing, onComplete:fGone});
  18.  
  19.  
  20. // Using other special properties (that are not related to a variable/property)
  21. Tweener.addTween(mySoundObject, {_sound_volume:100, time:1});
  22. Tweener.addTween(myMovieClip, {_frame:10, time:2.5});
  23.  
  24.  
  25. // Using tweener 'templates'
  26. var fadeIn:Object = {alpha:100, time:1};
  27. Tweener.addTween(myMovieClip, fadeIn);

URL: http://hosted.zeh.com.br/tweener/docs/en-us/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.