Using a custom easing function : Easing « Effects « Flex






Using a custom easing function

Using a custom easing function
         
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    backgroundColor="white">
    <mx:Script>
        public function myEasing(t:Number, b:Number, c:Number,d:Number):Number { 
            t/=d; 
            return b+c*(t); 
        }
    </mx:Script>
    <mx:Move id="myEffect" xBy="300" easingFunction="{myEasing}" />
    <mx:Button label="Make me move" mouseDownEffect="{myEffect}" />
</mx:Application>

   
    
    
    
    
    
    
    
    
  








Related examples in the same category

1.Creating a custom easing functionCreating a custom easing function
2.Resize with easing functionResize with easing function
3.Easing DemoEasing Demo
4.Bounce and Elastic easing classesBounce and Elastic easing classes