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

mochi

ポインタ位置についてくる
Get Adobe Flash player
by Scmiz 14 Jun 2011
/**
 * Copyright Scmiz ( http://wonderfl.net/user/Scmiz )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/qKwq
 */

package {
	import flash.display.Graphics;
    import flash.display.Sprite;
	import flash.events.Event;
	import flash.geom.Point;
    public class FlashTest extends Sprite {
		private var _array:/*Point*/Array;
		
        public function FlashTest() {
			_array = new Array();
			
			for (var index:uint = 0; index < 25; ++index) {
				_array.push(new Point(232, 232));
			}
			
			this.addEventListener(Event.ENTER_FRAME, proc);
        }
		
		private function update():void {
			for (var index:uint = 0; index < _array.length; ++index) {
				var intpRate:Number = 0.9 - (index * 0.03);
				
				_array[index].x = (mouseX * intpRate) + (_array[index].x * (1.0 - intpRate));
				_array[index].y = (mouseY * intpRate) + (_array[index].y * (1.0 - intpRate));
			}
		}

		private function draw():void {
			var g:Graphics = this.graphics;
			g.clear();
			g.beginFill(0x000000);
			g.drawRect(0, 0, 465, 465);
			g.endFill();

			for (var index:uint = 0; index < _array.length; ++index) {
				g.beginFill(0xffffff, 0.2);
				g.drawCircle(_array[index].x, _array[index].y, 50 + (index * 4));
				g.endFill();
			}
		}
		
		private function proc(e:Event):void {
			update();
			draw();
		}
    }
}