Tweenlite timeline setup


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



Copy this code and paste it in your HTML
  1. import com.greensock.*;
  2. import com.greensock.easing.*;
  3. import com.greensock.plugins.*;
  4. OverwriteManager.init(OverwriteManager.AUTO);
  5. TweenPlugin.activate([GlowFilterPlugin, TintPlugin]);
  6.  
  7. // create some variables used in tweens
  8. var tweenTime:Number = 0.5;
  9. var pauseTime:Number = 0.2;
  10. // create timeline
  11. var myTimeline:TimelineLite = new TimelineLite();
  12. // .append adds tweens onto the end of existing ones - like TweenGroup.ALIGN_SEQUENCE
  13. myTimeline.append(new TweenLite(mc1, tweenTime, {x:100}));
  14. myTimeline.append(new TweenLite(mc2, tweenTime, {y:100}));
  15. myTimeline.append(new TweenLite(nul, pauseTime, {})); // simple PAUSE - use any mc in the tween
  16. myTimeline.append(new TweenLite(mc1, tweenTime, {x:150}));
  17. myTimeline.append(new TweenLite(mc1, tweenTime, {x:250, delay:-tweenTime})); // use negative delays for simultaneous tweens

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.