PropertyTween
| Kind of class: | public class |
|---|---|
| Package: | org.casalib.transitions |
| Inherits from: | Tween < Process < RemovableEventDispatcher < EventDispatcher |
| Version: | 09/06/09 |
| Author: | Aaron Clinger, Mike Creighton, Jon Adams |
| Classpath: | org.casalib.transitions.PropertyTween |
| File last modified: | Sunday, 06 September 2009, 09:05:21 |
A simple property tween class that extends Tween.
Example:
-
package { import fl.motion.easing.Bounce; import org.casalib.display.CasaMovieClip; import org.casalib.display.CasaSprite; import org.casalib.transitions.PropertyTween; public class MyExample extends CasaMovieClip { protected var _box:CasaSprite; protected var _tween:PropertyTween; public function MyExample() { super(); this._box = new CasaSprite(); this._box.graphics.beginFill(0xFF00FF); this._box.graphics.drawRect(0, 0, 25, 25); this._box.graphics.endFill(); this.addChild(this._box); this._tween = new PropertyTween(this._box, "x", Bounce.easeOut, 200, 5); this._tween.start(); } } }
Usage note:
- If you want to tween a value other than a property use Tween.
Summary
Constructor
- PropertyTween (scope:Object, property:String, equation:Function, endPos:Number, duration:Number, useFrames:Boolean = false)
- Creates and defines a new PropertyTween.
Class properties
Class properties inherited from Process
Instance properties
- scope : Object
- Retrieves the object defined as scope in the class' constructor.
- property : String
- Retrieves the property as a String defined in the class' constructor.
Instance properties inherited from Tween
Instance properties inherited from Process
Instance properties inherited from RemovableEventDispatcher
Class methods
- to (scope:Object, property:String, equation:Function, endPos:Number, duration:Number, useFrames:Boolean = false) : PropertyTween
- A convenience method that creates and starts a new PropertyTween and starts it automatically.
- from (scope:Object, property:String, equation:Function, startPos:Number, duration:Number, useFrames:Boolean = false) : PropertyTween
- A convenience method that creates and starts a new PropertyTween and starts it automatically.
Instance methods
Instance methods inherited from RemovableEventDispatcher
Constructor
PropertyTween
public function PropertyTween (
scope:Object,
property:String,
equation:Function,
endPos:Number,
duration:Number,
useFrames:Boolean = false)
Creates and defines a new PropertyTween.
Parameters:
scope :
An object that contains the property specified by
property.property :
Name of the property you want to tween.
equation :
The tween equation.
endPos :
The ending value of the transition.
duration :
Length of time of the transition.
useFrames:
Indicates to use frames
true, or seconds false in relation to the value specified in the duration parameter.Usage note:
- The function specified in the
equationparameter must follow the (currentTime, startPosition, endPosition, totalTime) parameter standard.
Instance properties
property
public property:String
(read)
Retrieves the property as a String defined in the class' constructor.
scope
public scope:Object
(read)
Retrieves the object defined as scope in the class' constructor.
Class methods
from
public static function from (
scope:Object,
property:String,
equation:Function,
startPos:Number,
duration:Number,
useFrames:Boolean = false) : PropertyTween
A convenience method that creates and starts a new PropertyTween and starts it automatically.
Parameters:
scope :
An object that contains the property specified by
property.property :
Name of the property you want to tween.
equation :
The tween equation.
startPos :
The beginning value of the transition.
duration :
Length of time of the transition.
useFrames:
Indicates to use frames
true, or seconds false in relation to the value specified in the duration parameter.Returns:
- A {@PropertyTween property}.
to
public static function to (
scope:Object,
property:String,
equation:Function,
endPos:Number,
duration:Number,
useFrames:Boolean = false) : PropertyTween
A convenience method that creates and starts a new PropertyTween and starts it automatically.
Parameters:
scope :
An object that contains the property specified by
property.property :
Name of the property you want to tween.
equation :
The tween equation.
endPos :
The ending value of the transition.
duration :
Length of time of the transition.
useFrames:
Indicates to use frames
true, or seconds false in relation to the value specified in the duration parameter.Returns:
- A {@PropertyTween property}.