Tween Max quicky


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



Copy this code and paste it in your HTML
  1. TweenMax.to(event.target.txt, .4, {tint:0xFF0000, ease:Expo.EaseInOut, onComplete:myFunctionNam});
  2.  
  3.  
  4. ARGUMENTS:
  5. 1) $target : Object - Target MovieClip (or any other object) whose properties we're tweening
  6. 2) $duration : Number - Duration (in seconds) of the effect
  7. 3) $vars : Object - An object containing the end values of all the properties you'd like to have tweened (or if you're using the
  8. TweenLite.from() method, these variables would define the BEGINNING values). For example:
  9. alpha: The alpha (opacity level) that the target object should finish at (or begin at if you're
  10. using TweenLite.from()). For example, if the target.alpha is 1 when this script is
  11. called, and you specify this argument to be 0.5, it'll transition from 1 to 0.5.
  12. x: To change a MovieClip's x position, just set this to the value you'd like the MovieClip to
  13. end up at (or begin at if you're using TweenLite.from()).
  14. SPECIAL PROPERTIES (**OPTIONAL**):
  15. delay : Number - Amount of delay before the tween should begin (in seconds).
  16. ease : Function - You can specify a function to use for the easing with this variable. For example,
  17. gs.easing.Elastic.easeOut. The Default is Regular.easeOut.
  18. easeParams : Array - An array of extra parameters to feed the easing equation. This can be useful when you
  19. use an equation like Elastic and want to control extra parameters like the amplitude and period.
  20. Most easing equations, however, don't require extra parameters so you won't need to pass in any easeParams.
  21. autoAlpha : Number - Use it instead of the alpha property to gain the additional feature of toggling
  22. the visible property to false when alpha reaches 0. It will also toggle visible
  23. to true before the tween starts if the value of autoAlpha is greater than zero.
  24. visible : Boolean - To set a DisplayObject's "visible" property at the end of the tween, use this special property.
  25. volume : Number - Tweens the volume of an object with a soundTransform property (MovieClip/SoundChannel/NetStream, etc.)
  26. tint : Number - To change a DisplayObject's tint/color, set this to the hex value of the tint you'd like
  27. to end up at(or begin at if you're using TweenLite.from()). An example hex value would be 0xFF0000.
  28. removeTint : Boolean - If you'd like to remove the tint that's applied to a DisplayObject, pass true for this special property.
  29. frame : Number - Use this to tween a MovieClip to a particular frame.
  30. onStart : Function - If you'd like to call a function as soon as the tween begins, pass in a reference to it here.
  31. This is useful for when there's a delay.
  32. onStartParams : Array - An array of parameters to pass the onStart function. (this is optional)
  33. onUpdate : Function - If you'd like to call a function every time the property values are updated (on every frame during
  34. the time the tween is active), pass a reference to it here.
  35. onUpdateParams : Array - An array of parameters to pass the onUpdate function (this is optional)
  36. onComplete : Function - If you'd like to call a function when the tween has finished, use this.
  37. onCompleteParams : Array - An array of parameters to pass the onComplete function (this is optional)
  38. persist : Boolean - if true, the TweenLite instance will NOT automatically be removed by the garbage collector when it is complete.
  39. However, it is still eligible to be overwritten by new tweens even if persist is true. By default, it is false.
  40. renderOnStart : Boolean - If you're using TweenFilterLite.from() with a delay and want to prevent the tween from rendering until it
  41. actually begins, set this to true. By default, it's false which causes TweenLite.from() to render
  42. its values immediately, even before the delay has expired.
  43. overwrite : int - Controls how other tweens of the same object are handled when this tween is created. Here are the options:
  44. - 0 (NONE): No tweens are overwritten. This is the fastest mode, but you need to be careful not to create any
  45. tweens with overlapping properties, otherwise they'll conflict with each other.
  46.  
  47. - 1 (ALL): (this is the default unless OverwriteManager.init() has been called) All tweens of the same object
  48. are completely overwritten immediately when the tween is created.
  49. TweenLite.to(mc, 1, {x:100, y:200});
  50. TweenLite.to(mc, 1, {x:300, delay:2, overwrite:1}); //immediately overwrites the previous tween
  51.  
  52. - 2 (AUTO): (used by default if OverwriteManager.init() has been called) Searches for and overwrites only
  53. individual overlapping properties in tweens that are active when the tween begins.
  54. TweenLite.to(mc, 1, {x:100, y:200});
  55. TweenLite.to(mc, 1, {x:300, overwrite:2}); //only overwrites the "x" property in the previous tween
  56.  
  57. - 3 (CONCURRENT): Overwrites all tweens of the same object that are active when the tween begins.
  58. TweenLite.to(mc, 1, {x:100, y:200});
  59. TweenLite.to(mc, 1, {x:300, delay:2, overwrite:3}); //does NOT overwrite the previous tween because the first tween will have finished by the time this one begins.

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.