Play a Sequence : Sequence « Effects « Flex






Play a 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

1.Sequence EffectSequence Effect
2.Sequence Effect With EasingSequence Effect With Easing
3.Nesting two parallel composites in a sequence
4.Hide and show a controlHide and show a control
5.Using AnimateProperty to animate control by propertyUsing AnimateProperty to animate control by property
6.Animate the scaleX property of a controlAnimate the scaleX property of a control