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

perlinNoiseのお勉強

Get Adobe Flash player
by a24 16 Apr 2009
    Embed
package
{
	import flash.display.Sprite;
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.events.MouseEvent;

	public class Noise extends Sprite
	{
		private var bmpData:BitmapData;
		
		public function Noise()
		{
			bmpData = new BitmapData(465, 465, false);
			addChild(new Bitmap(bmpData));
			createNoize(null);
			
			stage.addEventListener(MouseEvent.CLICK , createNoize);
		}
		
		private function createNoize(e:MouseEvent):void
		{
			bmpData.perlinNoise(465 >> 1, 465 >> 1, 4, Math.random() * 0xFFFF, false, true, 3);
		}
	}
}