<animatorgroup>
Coordinates the behavior of several animators.

JavaScript: lz.animatorgroup
extends <node> » lz.Eventable »

An lz.animatorgroup wraps several <animator>s or <animatorgroup>s, and runs them in sequence or simultaneously. As an example, the code below animates a view first along the x-axis and then the y.

<canvas height="225">
   <view bgcolor="red" width="100" height="100">
     <animatorgroup process="sequential">
       <animator attribute="x" to="100" duration="1000"/>
       <animator attribute="y" to="100" duration="1000"/>
     </animatorgroup>
   </view>
 </canvas>

The attributes attribute, duration, from, indirect, motion, process, relative, started, target, and to are cascaded to enclosed <animator>s and <animatorgroup>s. Events (such as onstart, onstop, etc.) and the name and id attributes, however, are not cascaded.

Attributes

Name (CSS property) Type (tag) Type (js) Default Category
attribute token String   read/write
  The name of the attribute whose value is animated. This attribute is required on an animator, unless the animator is inside an animatorgroup that specifies an attribute.
duration number Number   read/write
  The duration of the animation, in milliseconds (1000 = 1 second).
from number Number   read/write
  The start value for the animation. Defaults to the targeted attribute's current value.
indirect boolean Boolean   read/write
  Controls the direction of the animation. A value of true will cause the animation to go in the "other" direction.
isactive boolean Boolean   readonly
 
[Caution] This attribute is deprecated
This is an internal property that will be removed. in a future release
The active-state of the animator. If true, the animator is currently processing its animation.
motion linear | easein | easeout | easeboth String easeboth read/write
  Whether and how the animation accelerates and decelerates
paused boolean Boolean false read/write
  The paused state of the animator. If true, the animator will pause. When changed to false, the animator will resume from its current location.
process simultaneous | sequential String sequential read/write
  In an <animatorgroup>, whether to process the individual <animator>s simultaneously or sequentially. Has no effect on an individual <animator>.
relative boolean Boolean false read/write
  Whether the to value is relative to the initial value of the attribute (true), or is an absolute value (false).
repeat number Number 1 read/write
  The number of times to repeat the animation. This should be a positive integer or Infinity. Changes to the repeat value while the animator is running will only take effect, after the animation is finished and then restarted.
[Note] Note
For historical reasons, setting this value does not send the event onrepeat; see onrepeat.
start boolean Boolean true initialize-only
 
[Caution] This attribute is deprecated
Use the `started` attribute instead.
[Note] Note
For historical reasons start is a write-only attribute, the ultimate effect of setting it can be observed through the onstart and onstop events. See also: paused.
A synonym for the `started` attribute.
started boolean Boolean true read/write
  Whether to start the animation immediately (default). Initialize to false to defer the animation. The starting and stopping of the animation can be controlled by setting this attribute.
[Note] Note
Setting this attribute to false resets the animation, such that it will be restarted from its initial state when this attribute is set to true. If you just want to pause the animation and then resume from the paused state, use the paused attribute.
target reference lz.node   read/write
  The object for which an attribute will be animated (by default, the immediate parent of the animator node)
to number Number   read/write
  The final value for the targeted attribute.

Methods

doStart()
animatorgroup.doStart();
[Caution] This method is deprecated
Use setAttribute('started', true) instead.
Start the animator

pause()
animatorgroup.pause(dop : Boolean);
[Caution] This method is deprecated
Use setAttribute('paused', ...) instead.
Temporarily pauses or restarts the animator
Parameter Name Type Description
dop Boolean If true, pauses the animator. If false, unpauses the animator. If null, toggles the paused state of the animator.

stop()
animatorgroup.stop();
[Caution] This method is deprecated
Use setAttribute('started', false) instead.
Stop the animation

Methods inherited from lz.Eventable

destroy, setAttribute

Events

Name Description
onrepeat Event sent when an animator restarts itself because its repeat attribute is greater than one.
[Note] Note
This event is not sent by the setting of the repeat attribute, but by the animator repeating itself. It is only sent on each repeat, not on the initial animation.
onstart Sent when the animator starts.
[Note] Note
For historical reasons this event is not sent by the setting of the start attribute, rather it is sent when the animator actually starts running.
onstop Sent when the animator finishes the entire animation (including any repetitions).

Events inherited from <node>

onconstruct, ondata, oninit

Events inherited from lz.Eventable

ondestroy