Play a Sequence : Sequence « Effects « Flex
- Flex
- Effects
- Sequence
Play a Sequence

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
horizontalScrollPolicy="off" verticalScrollPolicy="off">
<mx:Script>
[Bindable]
private var stageWidth:Number;
[Bindable]
private var stageHeight:Number;
private function bounce():void
{
stageHeight = stage.height;
stageWidth = stage.width;
myObject.play();
}
private function replaceBall():void
{
myImage.x = 0;
myImage.y = 0;
}
</mx:Script>
<mx:Sequence id="myObject" target="{myImage}" effectEnd="replaceBall()">
<mx:Move xTo="{stageWidth/5}" yTo="{stageHeight-myImage.height}"/>
</mx:Sequence>
<mx:Image id="myImage" source="@Embed('a.jpg')" x="{0-myImage.width}" y="{0-myImage.height}"/>
<mx:Button label="Bounce Ball" click="bounce()" right="10" bottom="10"/>
</mx:Application>
Related examples in the same category