base

Availability

AS2 and AS3.

Usage

... base:object, ...

Parameters

object:Object OR Array — An array OR an object containing properties and parameters to declare a new tweening. This object is used as the "base" of the new tweening, working as a kind of tweening inheritance, allowing more control when reusing object that declare tweening properties and parameters.

Examples

// WITHOUT base, using a tweening object to create a fade out animation (AS2)
var myFade:Object = {_alpha:0, time:1};
Tweener.addTween(myMovieClip, myFade);

// WITH base, but doing the same as above
var myFade:Object = {_alpha:0, time:1};
Tweener.addTween(myMovieClip, {base:myFade});

// WITH base, using the original "base" object to create a fade out animation with a different time
var myFade:Object = {_alpha:0, time:1};
Tweener.addTween(myMovieClip, {base:myFade, time:2});
// You can chain several different objects together
var myFade:Object = {_alpha:0, time:1};
var myFadeLong:Object = {base:myFade, time:10};
var myFadeShort:Object = {base:myFade, time:0.2};
Tweener.addTween(myMovieClip1, myFadeLong);
Tweener.addTween(myMovieClip2, myFadeShort);
// The "base" values are read when executing the addTween() method,
// so you can change values on the original base object AFTER assigning them as a base
// On the example below, _alpha goes to 50 in 10 seconds
var myFade:Object = {_alpha:0, time:1};
var myFadeLong:Object = {base:myFade, time:10};
myFade._alpha = 50;
Tweener.addTween(myMovieClip, myFadeLong);
// To ignore properties from the base object and set them to their default values, just set them to null
var myDelayedFade:Object = {_alpha:0, time:1, delay:1};
var myFade:Object = {base:myDelayedFade, delay:null};
Tweener.addTween(myMovieClip, myFade);
// WITH base, using an array of base objects:
var myFade:Object = {_alpha:0, time:1};
var myFadeLong:Object = {time:10};
Tweener.addTween(myMovieClip1, {base:[myFade, myFadeLong]});
// This is the equivalent of a nested base, such as:
var myFade:Object = {_alpha:0, time:1};
var myFadeLong:Object = {base:myFade, time:10};
Tweener.addTween(myMovieClip1, myFadeLong);