GreenSock animation platform Study Notes (1) TweenLite

Source: Internet
Author: User

Static attributes

TweenLite. defaultEase

Set the default easing Function

 

Static Method

TweenLite. (Target: Object,Duration: Number,Vars: Object): TweenLite

Function: used to create an animation.

Parameter: target: Specifies the video clip for which an animation is to be created.

Duration: the animation duration, in seconds (if the Animation Mode is frame-based, it is frame-based)

Vars: Specifies the attribute to be used in an animation. It is written as an object, for example, {x: 100, y: 100 ,...}, These attributes are the targets of animation completion.

Example:TweenLite.to(mc, 1, {x:100});

Var myTween: TweenLite = new TweenLite (mc, 1, {x: 100}); // the effect of the first code is the same

Var myTween: TweenLite = TweenLite. to (mc, 1, {x: 100}); // the effect of the first code is the same

TweenLite. from (Target: Object,Duration: Number,Vars: Object): TweenLite

Function: used to create an animation. Different from TweenLite. to, this function animation aims at the existing attribute of the video clip, and the initial attribute is the attribute set by vars.

Parameter: target: Specifies the video clip for which an animation is to be created.

Duration: the animation duration, in seconds (if the Animation Mode is frame-based, it is frame-based)

Vars: Specifies the attribute to be used in an animation. It is written as an object, for example, {x: 100, y: 100 ,...}, These attributes are the initial attributes of the animation.

Example:TweenLite.from(mc, 1, {x:100});

 

TweenLite. delayedCall (Delay: Number,OnComplete: Function,OnCompleteParams: Array = null,UseFrames: Boolean = false): TweenLite

Function: used to automatically execute a function after a certain time or a certain number of frames.

Parameter: delay: the time (or number of frames) for the function to be delayed)

OnComplete: function to be delayed

OnCompleteParams: the parameter of the function to be delayed, passed in as an array

UseFrames: Specifies whether to use time or number of frames for time recording.

Example:TweenLite.delayedCall(1, myFunction, ["param1", 2]);

TweenLite. killTweensOf (Target: Object, complete: Boolean = false, vars: Object = null): Void

Function: Used to eliminate animations.

Parameter: target: Specifies the video clip of the animation to be removed.

Complete: if it is true, the animation attribute is set as the value when the animation is eliminated. If it is false

Vars: to remove animation attributes and write them as objects, for example, {x: true, y: true ,...}, These attributes will no longer be involved in the animation

Example:TweenLite.killTweensOf(mc, false, {alpha:true, x:true});

Animation property object vars:

{

Delay: The time that the Number will wait before starting the animation, in seconds (or the Number of frames)

UseFrames: If Boolean is set to true, The Animation Mode is frame-based; otherwise, the Animation Mode is time-based (the place where the animation function needs to specify the time)

Bytes: Function easing Function. The default value is Quad. easeOut.

EaseParams: The parameters of the Array easing function are passed in as arrays. Note that parameters are required only for some easing functions.

ImmediateRender: When the value of Boolean is false,

Overwrite: Int is used to control the coverage of multiple animations on the same object. tweenlite is only available in 1 and 2 cases. For details, see OverwriteManager.

OnInit: Function: the Function to be executed before the animation starts rendering (or running ).

OnInitParams: The parameter of the Array onInit function, which is passed in as an Array.

OnStart: The Function to be executed when the animation starts rendering may be executed multiple times, because the animation can start repeatedly.

OnStartParams: Parameter of the Array onStart function, passed in as an Array

OnUpdate: Function called when the animation property value changes every time

OnUpdateParams: The parameter of the Array onUpdate function, which is passed in as an Array.

OnComplete: Function to be called after the animation is executed

OnCompleteParams: Parameter of the Array onComplete function, passed in as an Array

OnReverseComplete: Function the Function called when an animation is reversed and returned to the origin.

onReverseComplete: ArrayonReverseCompleteFunction parameters, passed in as an array

}

OverwriteManager

NONE (0)Animations on the same object are not overwritten.

ALL_IMMEDIATE (1)It will immediately overwrite all the previous Animations (including running and not running), and is also the default mode of tweenlite. the overwritten animation will keep the current state of the moment covered.

AUTO (2)When an animation starts to run (that is, it does not include latencies or pauses), and only overwrites the overlapping animation attributes in the running animation of the same object. It is the default overwrite mode of TweenMax, TimelineLite, and TimelineMax.

CONCURRENT (3)When the animation starts to run, it overwrites all the animations that are running on the same object.

ALL_ONSTART (4)When an animation starts to run, it overwrites all the animations on the same object (including running and not running)

PREEXISTING (5)When the animation starts to run, it will overwrite all the animations (including running and not running) created before the animation on the same object)

OverwriteManager. init (OverwriteManager. AUTO); can be used to define overwriting methods for all animations. If you want to define different overwriting methods for different animations, you can define them in a specific vars object.

The OverwriteManager class must be imported for Types 2, 3, 4, and 5.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.