In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

BetweenAS3を試してみる2

Get Adobe Flash player
by matsu4512 10 May 2009
    Embed

package {
	import flash.display.Shape;
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.events.Event;
	
	import org.libspark.betweenas3.BetweenAS3;
	import org.libspark.betweenas3.tweens.ITween;

	[SWF(backgroundColor=0x000000, width=512, height=512)]

	public class BetweenAS3_Particle2 extends Sprite
	{
		private var size:Number = 20;
		
		public function BetweenAS3_Particle2()
		{
			if(stage)
				init();
			else 
				addEventListener(Event.ADDED_TO_STAGE, init);
		}
		
		private function init():void{
			removeEventListener(Event.ADDED_TO_STAGE, init);
			
			stage.scaleMode = StageScaleMode.NO_SCALE;
			stage.align = StageAlign.TOP;
			
			for(var i:int = 0; i< 10; i++){
				for(var j:int = 0; j < 10; j++){
					var sh:Shape = new Shape();
					sh.x = i*size+150;
					sh.y = j*size+150;
					sh.scaleX = 0;
					sh.scaleY = 0;
					sh.graphics.beginFill(0x000000);
					sh.graphics.drawCircle(0, 0, size);
					sh.graphics.endFill();
		
					var t:ITween = BetweenAS3.serial(
						BetweenAS3.addChild(sh, this),
						BetweenAS3.tween(sh, 
										{scaleX:1, scaleY:1, transform:{colorTransform: {redOffset: 255, blueOffset: 255, greenOffset: 255}}},
										null,
										1),
						BetweenAS3.tween(sh, 
										{scaleX:0, scaleY:0, transform:{colorTransform: {redOffset: 0, blueOffset: 0, greenOffset: 0}}},
										{scaleX:1, scaleY:1, transform:{colorTransform: {redOffset: 255, blueOffset: 255, greenOffset: 255}}},
										1));
		
					t.stopOnComplete = false;
					t.play();
				}
			}
		}
	}
}