mx.transitions.Tween
|
+--com.robertpenner.effects.WaveMotion
The WaveMotion class encapsulates oscillation and allows easy manipulation of wave properties.
ActionScript 2.0; Flash Player 6
Property summary
| Property | Description |
|---|---|
| amp:Number |
The amplitude of the wave. |
| period:Number |
The period of the wave. |
| freq:Number |
The frequency of the wave. |
| timeShift:Number |
The timeshift of the wave. |
| offset:Number |
The offset of the wave. |
| duration:Number |
The duration of the tweened animation in frames or seconds. |
| finish:Number |
The last tweened value for the end of the tweened animation. |
| FPS:Number |
The number of frames per second of the tweened animation. |
| position:Number |
The current value of the target movie clip's property being tweened. |
| time:Number |
The current time within the duration of the animation. |
Event summary
| Event | Description |
|---|---|
| onMotionChanged = function() {} |
Event broadcast with each change in the tweened object's property that is being animated. |
| onMotionFinished = function() {} |
Event broadcast when the Tween object finishes its animation. |
| onMotionLooped = function() {} |
Event broadcast when the Tween object loops. |
| onMotionResumed = function() {} |
Event broadcast when the Tween.resume() method is called, causing the tweened animation to resume. |
| onMotionStarted = function() {} |
Event broadcast when the Tween.start() method is called, causing the tweened animation to start. |
| onMotionStopped = function() {} |
Event broadcast when the Tween.stop() method is called, causing the tweened animation to stop. |
Method summary
| Method | Description |
|---|---|
| setWavePhysics(amp:Number, period:Number, timeShift:Number, offset:Number) : Void |
Sets the amp, period, timeShift, and offset of the wave. |
| getPosition(t:Number) : Number |
Returns the position of the WaveMotion at a specified time. |
| continueTo(finish:Number, duration:Number) : Void |
Instructs the tweened animation to continue from its current value to a new value. |
| fforward() : Void |
Forwards the tweened animation directly to the end of the animation. |
| nextFrame() : Void |
Forwards the tweened animation to the next frame. |
| prevFrame() : Void |
Directs the tweened animation to the frame previous to the current frame. |
| resume() : Void |
Resumes a tweened animation from its stopped point in the animation. |
| rewind() : Void |
Rewinds a tweened animation to the beginning of the tweened animation. |
| start() : Void |
Starts the tweened animation from the beginning. |
| stop() : Void |
Stops the tweened animation at its current position. |
| toString() : String |
Returns the class name, "[WaveMotion]". |
| yoyo() : Void |
Instructs the tweened animation to play in reverse from its last direction of tweened property increments. |
var myWave:WaveMotion = new WaveMotion(this, "_x", 100, 1, 0, 0, true);
obj:Object
- The object which the WaveMotion targets.
prop:String
- The name of the property (in obj) that will be affected.
amp:Number
- The magnitude of the wave's oscillation.
period:Number
- The length of time it takes for the wave to go through one oscillation.
offset:Number
- The amount to shift the wave vertically on the position axis.
duration:Number
- The length of time of the motion; set to infinity if negative, 0 or omitted.
useSeconds:Boolean
- A flag specifying whether to use seconds instead of frames, defaults to false.
Creates an instance of the WaveMotion class.
myWave.setWavePhysics(80,2,.5,3);
amp:Number
- The magnitude of the wave's oscillation.
period:Number
- The length of time it takes for the wave to go through one oscillation.
timeShift:Number
- The amount to shift the wave horizontally on the time axis.
offset:Number
- The amount to shift the wave vertically on the position axis.
Nothing.
Sets the amp, period, timeShift, and offset of the wave.
trace (myWave.getPosition());
t:Number
- The time to check the object's position; set to the current time if omitted.
The position of the wave.
Returns the position of the WaveMotion at a specified time.
myTween.continueTo(myFinish, myDuration);
finish:Number
- A number indicating the ending value of the target object property that is to be tweened.
duration:Number
- A number indicating the length of time or number of frames for the tween motion.
Nothing.
Instructs the tweened animation to continue from its current value to a new value.
myTween.fforward();
Nothing.
Forwards the tweened animation directly to the end of the animation.
myTween.nextFrame();
Nothing.
Forwards the tweened animation to the next frame.
myTween.prevFrame();
Nothing.
Directs the tweened animation to the frame previous to the current frame.
myTween.resume();
Nothing.
Resumes a tweened animation from its stopped point in the animation.
myTween.rewind();
Nothing.
Rewinds a tweened animation to the beginning of the tweened animation.
myTween.start();
Nothing.
Starts the tweened animation from the beginning.
myTween.stop();
Nothing.
Stops the tweened animation at its current position.
trace (myWave.toString());
trace (myWave);
Returns the class name, "[WaveMotion]".
Returns the class name, "[WaveMotion]".
myTween.yoyo();
Nothing.
Instructs the tweened animation to play in reverse from its last direction of tweened property increments.
myTween.onMotionChanged = function() {
// ...
};
Nothing.
Event broadcast with each change in the tweened object's property that is being animated.
myTween.onMotionFinished = function() {
// ...
};
Nothing.
Event broadcast when the Tween object finishes its animation.
myTween.onMotionLooped = function() {
// ...
};
Nothing.
Event broadcast when the Tween object loops.
myTween.onMotionResumed = function() {
// ...
};
Nothing.
Event broadcast when the Tween.resume() method is called, causing the tweened animation to resume.
myTween.onMotionStarted = function() {
// ...
};
Nothing.
Event broadcast when the Tween.start() method is called, causing the tweened animation to start.
myTween.onMotionStopped = function() {
// ...
};
Nothing.
Event broadcast when the Tween.stop() method is called, causing the tweened animation to stop.
myWave.amp = 80;
The amplitude of the wave.
myWave.period = 2;
The period of the wave.
myWave.freq = .5;
The frequency of the wave.
myWave.timeShift = .5;
The timeshift of the wave.
myWave.offset = 3;
The offset of the wave.
trace (myTween.duration);
The duration of the tweened animation in frames or seconds.
trace (myTween.finish);
The last tweened value for the end of the tweened animation.
trace (myTween.FPS);
The number of frames per second of the tweened animation.
trace (myTween.position);
The current value of the target movie clip's property being tweened.
trace (myTween.time);
The current time within the duration of the animation.