Tweens an object along a CirclePath2D motion path in any direction (clockwise, counter-clockwise, or shortest).
The plugin recognizes the following properties:
- path : CirclePath2D - The CirclePath2D instance to follow (com.greensock.motionPaths.CirclePath2D)
- startAngle : Number - The position at which the target should begin its rotation (described
in degrees unless useRadians is true in which case it is described in radians).
For example, to begin at the top of the circle, use 270 or -90 as the startAngle.
- endAngle : Number - The position at which the target should end its rotation (described in
degrees unless useRadians is true in which case it is described in radians).
For example, to end at the bottom of the circle, use 90 as the endAngle
- autoRotate : Boolean - When
autoRotate
is true
, the target will automatically
be rotated so that it is oriented to the angle of the path. To offset this value (like to always add
90 degrees for example), use the rotationOffset
property.
- rotationOffset : Number - When
autoRotate
is true
, this value will always
be added to the resulting rotation
of the target.
- direction : String - The direction in which the target should travel around the path. Options are
Direction.CLOCKWISE
("clockwise"), Direction.COUNTER_CLOCKWISE
("counterClockwise"), or Direction.SHORTEST
("shortest").
- extraRevolutions : uint - If instead of going directly to the endAngle, you want the target to
travel one or more extra revolutions around the path before going to the endAngle,
define that number of revolutions here.
- useRadians : Boolean - If you prefer to define values in radians instead of degrees, set useRadians to true.
USAGE:
import com.greensock.*;
import com.greensock.plugins.*;
import com.greensock.motionPaths.*
TweenPlugin.activate([CirclePath2DPlugin]); //activation is permanent in the SWF, so this line only needs to be run once.
var circle:CirclePath2D = new CirclePath2D(150, 150, 100);
TweenLite.to(mc, 2, {circlePath2D:{path:circle, startAngle:90, endAngle:270, direction:Direction.CLOCKWISE, extraRevolutions:2}});
Copyright 2010, GreenSock. All rights reserved. This work is subject to the terms in
http://www.greensock.com/terms_of_use.html or for corporate Club GreenSock members, the software agreement that was issued with the corporate membership.