flash on 2009-11-6
Progression4のサンプルのTweenListの勉強用
少しだけ勉強用に変更しました。
/**
* Copyright yabuchany ( http://wonderfl.net/user/yabuchany )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/ayOl
*/
// Progression4のサンプルのTweenListの勉強用
// 少しだけ勉強用に変更しました。
package {
import fl.motion.easing.*;
import flash.display.Sprite;
import flash.events.Event;
import jp.progression.commands.lists.LoopList;
import jp.progression.commands.lists.TweenList;
import jp.progression.commands.tweens.DoTweener;
public class Main4 extends Sprite {
public function Main4 () {
addEventListener( Event.ADDED_TO_STAGE , initialize );
}
protected function initialize ( evt:Event ):void {
removeEventListener( Event.ADDED_TO_STAGE , initialize );
var list1:TweenList=new TweenList( 1 , Back.easeInOut );
var list2:TweenList=new TweenList( 1 , Back.easeInOut );
var list3:TweenList=new TweenList( 1 , Back.easeOut );
var list4:TweenList=new TweenList( 1 , Bounce.easeOut );
for ( var i:int=0 , l:int=20 ; i < l ; i++ ) {
var sp:Sprite=new Sprite();
sp.graphics.beginFill( 0xFFFFFF * Math.random());
sp.graphics.drawRect( 0 , 0 , 480 , 24 ); // x,y,幅,高さ
sp.graphics.endFill();
sp.y=24 * i;
sp.scaleX=0;
addChild( sp );
list1.addCommand( new DoTweener( sp , { scaleX: .5 , time: 1 }));
list2.addCommand( new DoTweener( sp , { scaleX: 0 , time: 1 }));
list3.addCommand( new DoTweener( sp , { scaleY: .8 , time: 1 }));
list4.addCommand( new DoTweener( sp , { scaleY: 1 , time: 1 }));
}
var com:LoopList=new LoopList( 0 , null ,
list1 ,
list3 ,
list4,
list2
);
com.execute();
}
}
}