Name

animatorgroup (LzAnimatorGroup) — Coordinates the behavior of several animators.

Synopsis

LZX: animatorgroup
JavaScript: LzAnimatorGroup
Type: Class
Access: public
Topic: LFC.Animation
Declared in: WEB-INF/lps/lfc/controllers/LzAnimatorGroup.lzs

Description

An LzAnimatorGroup wraps several LzAnimators, 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>
 

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.

Superclass Chain

node (LzNode) » animatorgroup (LzAnimatorGroup)

Known Subclasses

Known Direct Subclasses: animator (LzAnimator)

Details

Properties (14)

animatorProps
<attribute name="animatorProps" value="{ ... }" />
public var animatorProps = { ... };
attribute
<attribute name="attribute" type="token" />
public var attribute : String;
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
<attribute name="duration" type="xsd:float {minInclusive="0"} | constraint" />
public var duration : Number;
The duration of the animation, in milliseconds (1000 = 1 second).
from
<attribute name="from" type="number" />
public var from : Number;
The start value for the animation. Defaults to the targeted attribute's current value.
indirect
<attribute name="indirect" type="boolean" />
public var indirect : Boolean = false;
motion
<attribute name="motion" type=""linear" | "easein" | "easeout" | "easeboth"" />
public var motion : String = easeboth;
paused
<attribute name="paused" type="boolean" />
public var paused : boolean;
If true, the running animator will pause. If false it will resume
process
<attribute name="process" type="string" />
public var process : string = sequential;
"simultaneous" or none
means process animators simultaneously
"sequential"
means process animators sequentially;
Animators other than animatorgroups ignore this attribute
relative
<attribute name="relative" type="boolean" value=""false"" />
public var relative : Boolean = false;
Whether the to value is relative to the initial value of the attribute (true), or is absolute (false).
repeat
<attribute name="repeat" type="expression" />
public var repeat : String;
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
<attribute name="start" type="boolean" value=""true"" />
public var start : Boolean = true;
Whether to start the animation instantly (the default), or wait for a script command.
started
<attribute name="started" type="boolean" />
public var started : Boolean;
Value of the animator's start attribute.
target
<attribute name="target" type="string" />
public var target : string;
The object to animate
to
<attribute name="to" type="number" />
public var to : Number;
The final value for the targeted attribute.

Setters (3)

Setters for virtual properties, to be used with setAttribute. A setter may or may not have a corresponding getter method; consult the Methods list in this section.

paused
start
target

Methods (4)

doStart()
<method name="doStart" />
public function doStart();
called to set starting flags and values, send onstart event, and register animator for processing on the main idle loop.
pause()
<method name="pause" args="dop" />
public function pause(dop : Boolean);
Temporarily pauses or restarts the animator
setTarget()
<method name="setTarget" args="new_target" />
public function setTarget(new_target);
setter for the target attribute
stop()
<method name="stop" />
public function 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.

Events (8)

onduration
<attribute name="onduration" />
public event onduration;
onfinish
<attribute name="onfinish" />
public deprecated event onfinish;
Use of 'onfinish' event is deprecated. Use 'onstop' event instead.
onpaused
<attribute name="onpaused" />
public event onpaused;
onrepeat
<attribute name="onrepeat" />
public event onrepeat;
Event sent at the beginning of each new repeat.
onstart
<attribute name="onstart" />
public event onstart;
Executed when the animator starts. This code is executed multiple times if the animator repeats.
onstarted
<attribute name="onstarted" />
public event onstarted;
onstop
<attribute name="onstop" />
public event onstop;
Executed when the animator finishes.
ontarget
<attribute name="ontarget" />
public event ontarget;

LZX Synopsis

<class name="LzAnimatorGroup" extends=" LzNode ">
  <attribute name=" animatorProps " value="{ ... }" />
  <attribute name=" attribute " type="token" />
  <attribute name=" duration " type="xsd:float {minInclusive="0"} | constraint" />
  <attribute name=" from " type="number" />
  <attribute name=" indirect " type="boolean" />
  <attribute name=" motion " type=""linear" | "easein" | "easeout" | "easeboth"" />
  <attribute name=" paused " type="boolean" />
  <attribute name=" process " type="string" />
  <attribute name=" relative " type="boolean" value=""false"" />
  <attribute name=" repeat " type="expression" />
  <attribute name=" start " type="boolean" value=""true"" />
  <attribute name=" started " type="boolean" />
  <attribute name=" target " type="string" />
  <attribute name=" to " type="number" />
  <method name=" doStart " />
  <event name=" onduration " />
  <event name=" onfinish " />
  <event name=" onpaused " />
  <event name=" onrepeat " />
  <event name=" onstart " />
  <event name=" onstarted " />
  <event name=" onstop " />
  <event name=" ontarget " />
  <method name=" pause " args="dop" />
  <method name=" setTarget " args="new_target" />
  <method name=" stop " />
</class>

JavaScript Synopsis

public LzAnimatorGroup extends  LzNode  {
  public var animatorProps  = { ... };
  public var attribute  : String;
  public var duration  : Number;
  public var from  : Number;
  public var indirect  : Boolean = false;
  public var motion  : String = easeboth;
  public var paused  : boolean;
  public var process  : string = sequential;
  public var relative  : Boolean = false;
  public var repeat  : String;
  public var start  : Boolean = true;
  public var started  : Boolean;
  public var target  : string;
  public var to  : Number;
  prototype public function doStart ();
  prototype public event onduration ;
  prototype public deprecated event onfinish ;
  prototype public event onpaused ;
  prototype public event onrepeat ;
  prototype public event onstart ;
  prototype public event onstarted ;
  prototype public event onstop ;
  prototype public event ontarget ;
  prototype public function pause (dop : Boolean);
  prototype public function setTarget (new_target);
  prototype public function stop ();
}