<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" xmlns:utils="utils.*"
width="150" height="300"
viewSourceURL="srcview/index.html">
<fx:Script>
<![CDATA[
import utils.AnimationEvent;
private function updateHandler(event:AnimationEvent):void
{
button.y = event.animation.currentValue["y"];
}
]]>
</fx:Script>
<fx:Declarations>
<utils:AnimationTargetDispatcher id="animTarget"
update="updateHandler(event)"/>
<s:Bounce id="bounce"/>
<s:Animation id="anim" duration="1500"
animationTarget="{animTarget}"
easer="{bounce}">
<s:SimpleMotionPath property="y" valueFrom="0"
valueTo="{height - button.height}"/>
</s:Animation>
</fx:Declarations>
<s:Button id="button" label="Move Me" click="anim.play()"/>
</s:Application>