Package | com.desuade.motion.tweens |
Class | public class BasicTween |
Inheritance | BasicTween ![]() ![]() |
Subclasses | BasicColorTween, BasicMultiTween, Tween |
Language Version : | ActionScript 3 |
Since : | 01.05.2009 |
Runtime Versions : | AIR 1.0, Flash Player 9.0.0 |
Method | Defined By | ||
---|---|---|---|
BasicTween(target:Object, configObject:Object = null)
The constructor accepts an object that has all the paramaters needed to create a new tween.
Paramaters for the configObject:
property:String – the property to tween
value:– the new (end) value. | BasicTween | ||
![]() | fromXML(xml:XML):*
Configures the object based on the values provided by the XML.
Most properties can assigned in the attributes using the same names.
The values of the attributes will be converted to Numbers if they're not NaN. | BaseBasic | |
run(target:Object, property:String, value:*, duration:Number, ease:* = linear, position:Number = 0, endfunc:Function = null):int [static]
This let's you run a tween that's unmanaged and bypasses events, using just a callback function on end.
The syntax is just a strict function call, so there's no configObject.
While there's little speed improvement with this over creating an tween object, it does use about half the memory.
| BasicTween | ||
![]() | start(delay:Number = -1, position:Number = -1):*
This starts and creates the primitive. | BaseBasic | |
![]() | stop():Boolean
This stops and removes the primitive. | BaseBasic | |
![]() | toXML():XML
This creates an XML object that represents the object, based on it's config object. | BaseBasic |
BasicTween | () | Constructor |
public function BasicTween(target:Object, configObject:Object = null)
The constructor accepts an object that has all the paramaters needed to create a new tween.
Paramaters for the configObject:
{value: 100}
or {value:"200"}
Example: var mt:BasicTween = new BasicTween(myobj, {property:'x', value:.5, duration:2, ease:'easeInBounce'})
target:Object — The target object to have it's property tweened
| |
configObject:Object (default = null ) — The config object that has all the values for the tween
|
See also
run | () | method |
public static function run(target:Object, property:String, value:*, duration:Number, ease:* = linear, position:Number = 0, endfunc:Function = null):int
This let's you run a tween that's unmanaged and bypasses events, using just a callback function on end.
The syntax is just a strict function call, so there's no configObject.
While there's little speed improvement with this over creating an tween object, it does use about half the memory.
Parameters
target:Object — The target object to have it's property tweened
| |
property:String — The property to tween
| |
value:* — The new (end) value. Passing a Number will tween it to that absolute value, passing a String will use a relative value (target.property + value) - ie: {value: 100} or {value:"200"}
| |
duration:Number — How long in seconds for the tween to last
| |
ease:* (default = linear ) — The easing to use. Default is 'linear'. Can pass a Function, but will not work with XML
| |
position:Number (default = 0 ) — The position to start the tween at. Defaults 0.
| |
endfunc:Function (default = null ) — A function to call when the tween ends
|
int — The id of the PrimitiveTween
|