BetweenAS3 easingいろいろ練習

by kazuyuki
♥0 | Line 60 | Modified 2010-04-14 00:19:15 | MIT License
play

ActionScript3 source code

/**
 * Copyright kazuyuki ( http://wonderfl.net/user/kazuyuki )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/6R1B
 */

package {
    import flash.display.Sprite;
    import flash.events.Event;
    import org.libspark.betweenas3.BetweenAS3;
    import org.libspark.betweenas3.easing.*;
    import org.libspark.betweenas3.tweens.ITween;

	
    import flash.utils.Timer;
    public class FlashTest extends Sprite {
        public function FlashTest() {
          
          
           	var box1:Box = addbox(0); 
           	var box2:Box = addbox(30);
           	var box3:Box = addbox(60);
           	var box4:Box = addbox(90);
           	var box5:Box = addbox(120);
           	var box6:Box = addbox(150);
           	var box7:Box = addbox(180);
           	var box8:Box = addbox(210);
           	var box9:Box = addbox(240);
            	var box10:Box = addbox(270);	
            	var box11:Box = addbox(300);	
            	var box12:Box = addbox(330);	
            	var box13:Box = addbox(360);	
            	var box14:Box = addbox(390);	
            	var box15:Box = addbox(420);	
            	              	
        	    		
        		var t0:ITween;
        		
        		t0 = BetweenAS3.serial(
        			BetweenAS3.tween(box1,{y:400}, null, 3, Quart.easeIn),
        			BetweenAS3.tween(box2,{y:400}, null, 3, Back.easeOut),
        			BetweenAS3.tween(box3,{y:400}, null, 3, Expo.easeInOut),
        			BetweenAS3.tween(box4,{y:400}, null, 3, Elastic.easeInOut),
        			BetweenAS3.tween(box5,{y:400}, null, 3, Expo.easeIn),
        			BetweenAS3.tween(box6,{y:400}, null, 3, Elastic.easeIn),
        			BetweenAS3.tween(box7,{y:400}, null, 3, Elastic.easeOut),
        			BetweenAS3.tween(box8,{y:400}, null, 3, Bounce.easeOut),
        			BetweenAS3.tween(box9,{y:400}, null, 3, Bounce.easeIn),
        			BetweenAS3.tween(box10,{y:400}, null, 3, Elastic.easeInOut),
        			BetweenAS3.tween(box11,{y:400}, null, 3, Back.easeOut),
        			BetweenAS3.tween(box12,{y:400}, null, 3, Circ.easeInOut),
        			BetweenAS3.tween(box13,{y:400}, null, 3, Quint.easeInOut),
        			BetweenAS3.tween(box14,{y:400}, null, 3, Elastic.easeInOut),
        			BetweenAS3.tween(box15,{y:400}, null, 3, Bounce.easeInOut)       			

      		)   
        		t0.play();  
        		}
        		
        private function addbox(x:Number):Box{
        		  var box:Box = new Box();
        		  box.x = x;
        		  addChild(box);
        		  return box;
        	}	
    }
} 

import flash.display.Sprite;
internal class Box extends Sprite{
	
	public function Box(){
		graphics.beginFill(0x000000);
		graphics.drawRect(0,0,30,30);
		graphics.endFill(); 
	}
}
		

Forked