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

LineTrace

...
@author tkinjo
Get Adobe Flash player
by tkinjo 17 May 2009
/**
 * Copyright tkinjo ( http://wonderfl.net/user/tkinjo )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/duGO
 */

package 
{
	import com.flashdynamix.motion.Tweensy;
	import com.flashdynamix.motion.TweensyTimeline;
	import fl.motion.easing.Linear;
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.Sprite;
	import flash.events.Event;
	
	[SWF(width = "465", height = "465", frameRate = "60", backgroundColor = "#000000")]
	
	/**
	 * ...
	 * @author tkinjo
	 */
	public class IndexPage extends Sprite
	{
		/**
		 * 
		 */
		private const HORIZONTAL_LINES:uint = 20;
		
		/**
		 * 
		 */
		private const VERTICAL_LINES:uint = 20;
		
		/**
		 * 
		 */
		private const DRAW_LINE_DURATION:Number = 0.01;
		
		/**
		 * 
		 */
		private var displayBitmap:Bitmap;
		
		/**
		 * 
		 */
		private var lineBitmap:Bitmap;
		
		/**
		 * 
		 */
		private var repeat:uint;
		
		/**
		 * 
		 */
		private var lineTweenTimeline:TweensyTimeline;
		
		/**
		 * 
		 */
		public function IndexPage() 
		{
			/**
			 * 
			 */
			displayBitmap = new Bitmap( new BitmapData( stage.stageWidth, stage.stageHeight ) );
			addChild( displayBitmap );
			
			/**
			 * 線の bitmap を生成
			 */
			var line:Sprite = new Sprite();
			line.graphics.beginFill( 0x000000, 0.5 );
			line.graphics.drawRect( 0, 0, 2, 2 );
			
			var lineBitmapData:BitmapData = new BitmapData( 2, 2 );
			lineBitmapData.draw( line );
			
			lineBitmap = new Bitmap( lineBitmapData );
			addChild( lineBitmap );
			
			/**
			 * 
			 */
			repeat = 0;
			
			lineTweenTimeline = Tweensy.fromTo( lineBitmap, { scaleX:0 }, { scaleX:stage.stageWidth / lineBitmap.width }, DRAW_LINE_DURATION, Linear.easeIn );
			lineTweenTimeline.onComplete = hotizontalDrawLineHandler;
		}
		
		/**
		 * 
		 */
		private function hotizontalDrawLineHandler():void {
			
			displayBitmap.bitmapData.draw( stage );
			
			if ( repeat < HORIZONTAL_LINES ) {
				
				repeat++;
				lineBitmap.y = uint( stage.stageHeight / HORIZONTAL_LINES * repeat );
				lineTweenTimeline.replay();
				
			} else {
				
				repeat = 0;
				lineBitmap.y = 0;
				lineBitmap.scaleX = 1;
				
				/**
				 * 
				 */
				lineTweenTimeline = Tweensy.fromTo( lineBitmap, { scaleY:0 }, { scaleY:stage.stageHeight / lineBitmap.height }, DRAW_LINE_DURATION, Linear.easeIn );
				lineTweenTimeline.onComplete = verticalDrawLineHandler;
			}
		}
		
		/**
		 * 
		 */
		private function verticalDrawLineHandler():void {
			
			displayBitmap.bitmapData.draw( stage );
			
			if ( repeat < VERTICAL_LINES ) {
				
				repeat++;
				lineBitmap.x = uint( stage.stageWidth / VERTICAL_LINES * repeat );
				lineTweenTimeline.replay();
				
			} else {
				
				repeat = 0;
				lineBitmap.x = 0;
				lineBitmap.scaleY = 1;
			}
		}
	}
}