Titanium.UI.Animation

Object of Titanium.UI.
Platform Since
Android 0.9
iPhone 0.9
iPad 0.9

Summary

The Animation object is used for specifying lower-level animation properties and more low-level control of events during an animation. The Animation is created by the method Titanium.UI.createAnimation.

Code Examples

Animation applied to a view

Create a simple animation and apply it to the view. In this example, the view will animate from red to black to orange over 2 seconds.

var view = Titanium.UI.createView({
   backgroundColor:'red'
});
var animation = Titanium.UI.createAnimation();
animation.backgroundColor = 'black';
animation.duration = 1000;
var animationHandler = function() {
   animation.removeEventListener('complete',animationHandler);
   animation.backgroundColor = 'orange';
   view.animate(animation);
};
animation.addEventListener('complete',animationHandler);
view.animate(animation);

Methods

Name Summary
addEventListener

Adds the specified callback as an event listener for the named event.

fireEvent

Fires a synthesized event to any registered listeners.

getAutoreverse

Gets the value of the autoreverse property.

getBackgroundColor

Gets the value of the backgroundColor property. (iPhone, iPad only.)

getBottom

Gets the value of the bottom property.

getCenter

Gets the value of the center property.

getColor

Gets the value of the color property. (iPhone, iPad only.)

getCurve

Gets the value of the curve property. (iPhone, iPad only.)

getDelay

Gets the value of the delay property.

getDuration

Gets the value of the duration property.

getHeight

Gets the value of the height property.

getLeft

Gets the value of the left property.

getOpacity

Gets the value of the opacity property.

getOpaque

Gets the value of the opaque property. (iPhone, iPad only.)

getRepeat

Gets the value of the repeat property.

getRight

Gets the value of the right property.

getTop

Gets the value of the top property.

getTransform

Gets the value of the transform property.

getTransition

Gets the value of the transition property. (iPhone, iPad only.)

getVisible

Gets the value of the visible property. (iPhone, iPad only.)

getWidth

Gets the value of the width property.

getZIndex

Gets the value of the zIndex property. (iPhone, iPad only.)

removeEventListener

Removes the specified callback as an event listener for the named event.

setAutoreverse

Sets the value of the autoreverse property.

setBackgroundColor

Sets the value of the backgroundColor property. (iPhone, iPad only.)

setBottom

Sets the value of the bottom property.

setCenter

Sets the value of the center property.

setColor

Sets the value of the color property. (iPhone, iPad only.)

setCurve

Sets the value of the curve property. (iPhone, iPad only.)

setDelay

Sets the value of the delay property.

setDuration

Sets the value of the duration property.

setHeight

Sets the value of the height property.

setLeft

Sets the value of the left property.

setOpacity

Sets the value of the opacity property.

setOpaque

Sets the value of the opaque property. (iPhone, iPad only.)

setRepeat

Sets the value of the repeat property.

setRight

Sets the value of the right property.

setTop

Sets the value of the top property.

setTransform

Sets the value of the transform property.

setTransition

Sets the value of the transition property. (iPhone, iPad only.)

setVisible

Sets the value of the visible property. (iPhone, iPad only.)

setWidth

Sets the value of the width property.

setZIndex

Sets the value of the zIndex property. (iPhone, iPad only.)

Properties

Name Type Summary
autoreverse Boolean

the property specifies if the animation should be replayed in reverse upon completion

backgroundColor String

value of the backgroundColor property to change during animation (iPhone, iPad only.)

bottom Number

value of the bottom property to change during animation

center Object

value of the center property to change during animation

color String

value of the color property to change during animation (iPhone, iPad only.)

curve Number

the curve of the animation (iPhone, iPad only.)

delay Number

the duration of time in milliseconds before starting the animation

duration Number

the duration of time in milliseconds to perform the animation

height Number

value of the height property to change during animation

left Number

value of the left property to change during animation

opacity Number

value of the opacity property to change during animation

opaque Boolean

value of the opaque property to change during animation (iPhone, iPad only.)

repeat Number

the number of times the animation should be performed

right Number

value of the right property to change during animation

top Number

value of the top property to change during animation

transform Object

value of the transform property to change during animation

transition Number

during a transition animation, this is the constant to the type of transition to use (iPhone, iPad only.)

visible Boolean

value of the visible property to change during animation (iPhone, iPad only.)

width Number

value of the width property to change during animation

zIndex Number

value of the zIndex property to change during animation (iPhone, iPad only.)

Events

Name Summary
complete

fired when the animation completes

start

fired when the animation starts