<animatorgroup>
Coordinates the behavior of several animators.

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

An lz.animatorgroup wraps several <animator>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>
   <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>
edit

Any attribute that is legal in <animator> is legal in <animatorgroup>. These attributes are then cascaded to the animators contained within.

Events (such as onstart, onstop, etc.) and the name and id attributes, however, are not cascaded. Also, start defined at the group level is effectively cascaded to the animators, meaning that the start attribute is ignored in the animators themselves.

Attributes

Name 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 xsd:float {minInclusive="0"} | constraint 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
   
isactive boolean Boolean   read/write
  The active-state of the animator. If true, the animator is currently processing its animation. This field is read-only.
motion token String   read/write
  One of "linear" | "easein" | "easeout" | "easeboth"
paused boolean Boolean "false" read/write
  The paused state of the animator. If true, the animator will stop. When changed to false, the animator will resume from its current location.
process string String   read/write
 
"simultaneous" or none
means process animators simultaneously
"sequential"
means process animators sequentially;
Animators other than animatorgroups ignore this attribute
relative boolean Boolean "false" read/write
  Whether the to value is relative to the initial value of the attribute (true), or is absolute (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 take effect, after the animation is finished and then restarted.
start boolean Boolean "true" read/write
  Whether to start the animation instantly (the default), or wait for a script command.
started boolean Boolean   read/write
  Value of the animator's start attribute.
target reference String   read/write
  the object for which an attribute will be animated (by default, this is the immediateParent)
to number Number   read/write
  The final value for the targeted attribute.

Methods

doStart()
animatorgroup.doStart();
Called to set starting flags and values, send onstart event, and register animator for processing on the main idle loop.

pause()
animatorgroup.pause(dop : Boolean);
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();
Stop is called when the animation is complete, or when the animator is destroyed. It can also be called to halt a running animation.

Methods inherited from lz.Eventable

destroy, setAttribute

Events

Name Description
onduration  
onpaused  
onrepeat Event sent at the beginning of each new repeat.
onstart Executed when the animator starts. This code is executed multiple times if the animator repeats.
onstarted  
onstop Executed when the animator finishes.
ontarget  

Events inherited from <node>

onconstruct, ondata, oninit

Events inherited from lz.Eventable

ondestroy