[Flash Basic theory lesson 10] easing effect [tween class]

Source: Internet
Author: User
Tags range

Back to "flash Basic Theory Class-Catalog"

The Tween class, which appears when you launch FLASHMX, allows you to easily move, scale, and fade movie clips on the stage. The essence is used to add as transition animation, very convenient to use.

Use of the Tween class:

The Tween class is an external class, so before you use it, you should first import:

Import Mx.transitions.Tween;

Import of easing methods in the Tween class: Open the entire package with easing.*, and all methods are loaded

Import mx.transitions.easing.*;

Introduction to the parameters of tween class constructors

function Tween(obj, prop, func, begin, finish, duration, useSeconds)

{
    // 代码……
}

Obj (instance name) Tween the target movie clip object for the instance.

The string name of the property of Prop (property) obj.

Func (effect) easing effect of the easing method.

The start value of the Begin (Start) property.

The end value of the finish (end) property.

Duration (time) A number that indicates the length of time for the motion tween.

Useseconds (in seconds) A Boolean value that, if true, indicates that the second is used, and if false, the frame is used.

For example:

new Tween(mc, "_x", Back.easeInOut, mc._x, 300, 4, true);

Easing effect (func parameter):

Extend the animation once in the back transition range to produce an effect that pulls out of its range.

Bounce the transition range of the bounce effect. The number of hops is related to duration, the longer the duration, the more the bounce number.

Elastic the elastic effect beyond the transition range. Elasticity is not affected by duration.

Regular a slower movement. Acceleration effect, deceleration effect, or both effects.

Strong a slower movement. This effect is similar to the Regular easing class, but it is more pronounced.

None without any deceleration or acceleration effect of the movement. This transition is also known as a linear transition.

Each of the six ease computing classes has three easing methods, which are described in the following table:

The Easein provides easing effects at the beginning of the transition.

Easeout provides easing effects at the end of the transition.

Easeinout provides easing effects at the beginning and end of a transition.

Easenone indicates that the ease calculation is not used. Provided only in the None easing class.

See here, is not a little dizzy, oh, theory is so. The essence of the tween class is actually to change the object's properties from begin (start) to finish (end) and effect. Okay, here's an example, let's combine theoretical practice with the argument above

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.