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

グラデーションな玉を作ってみる

Get Adobe Flash player
by Renowan 11 Mar 2010
/**
 * Copyright Renowan ( http://wonderfl.net/user/Renowan )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/tJPa
 */

 package
{
	import frocessing.color.ColorHSV;
	
	import flash.display.MovieClip;
	import flash.events.MouseEvent;
	import flash.events.Event;
	
	import caurina.transitions.Tweener;
	
	public class Main extends MovieClip
	{
		static private var col:int = 0;

		public function Main() 
		{
			addEventListener( Event.ENTER_FRAME , ONENTER );
		}
		
		public function ONENTER(e:Event){
			var Henx:Number = Math.floor( Math.random() * ( stage.stageWidth * 2 - 100 ) ) - (stage.stageWidth/2);
			var Heny:Number = Math.floor( Math.random() * ( stage.stageHeight * 2 - 100 ) ) - (stage.stageHeight/2);
			var mx:Number = mouseX;
			var my:Number = mouseY;
			var Hankei:Number = Math.floor( Math.random() * 20 ) - 20;
			var color:ColorHSV = new ColosrHSV(col += 5, 0.7);
			
			var _maru: MovieClip = new MovieClip();
			_maru.graphics.beginFill(color.value, 0.5);
			_maru.graphics.drawCircle(mx , my , Hankei);
			_maru.graphics.beginFill(color.value, 1);
			_maru.graphics.drawCircle(mx , my , Hankei+4);
			addChild(_maru);
			
			Tweener.addTween( _maru , { x:Henx , y:Heny , time:2.6 , delay:0.0 , transition:"easeOutCubic" });
			Tweener.addTween( _maru , { alpha:0 , time:0.7 , delay:2.2 , transition:"easeOutCubic" , onComplete:function() { removeChild(_maru) } });
			
		}
		
	}

}