Capítulo 38 de 411

Chapter 38: Timeline.add()

Core Idea

add() inserts a tween, timeline, callback, or label (or an array of them) into the timeline at a specific position.

Reference Tables

ParameterTypeDefaultDescription
childTween | Timeline | Label | Callback | Arraywhat to add
positionNumber | String | Label"+=0"insertion point; a not-yet-existing label is auto-added at the current end

Returns: self (chainable).

Code Examples

tl.add(childTween, "+=0.5"); // insert half a second after the current end

Key Takeaways

  1. This is the general-purpose insertion method underlying the more convenient .to()/.from()/.call() shortcuts.
  2. The position parameter (relative "+=n", absolute number, or a label) controls exactly where in the sequence something lands — see the Position Parameter guide for the full syntax.

Connects To

  • Position Parameter (Guide): full syntax reference for the position argument used across nearly every Timeline insertion method.