antun
12-05-2003, 03:49 PM
You can use an <animatorgroup> to have several animators act on a view in sequence:
<canvas>
<view name="foo" bgcolor="red" width="50" height="50"
clickable="true" onclick="fooAnim.start()">
<animatorgroup name="fooAnim" process="sequential" start="false">
<animator attribute="x" from="0" to="300" duration="750"
relative="false" />
<animator attribute="y" from="0" to="300" duration="750"
relative="true" />
<animator attribute="x" to="-300" duration="750"
relative="true" />
<animator attribute="y" to="-300" duration="750"
relative="true" />
</animatorgroup>
</view>
</canvas>
Enjoy!
<canvas>
<view name="foo" bgcolor="red" width="50" height="50"
clickable="true" onclick="fooAnim.start()">
<animatorgroup name="fooAnim" process="sequential" start="false">
<animator attribute="x" from="0" to="300" duration="750"
relative="false" />
<animator attribute="y" from="0" to="300" duration="750"
relative="true" />
<animator attribute="x" to="-300" duration="750"
relative="true" />
<animator attribute="y" to="-300" duration="750"
relative="true" />
</animatorgroup>
</view>
</canvas>
Enjoy!