flash on 2009-7-13

by doiiob5555
♥2 | Line 23 | Modified 2009-07-13 12:39:07 | MIT License
play

ActionScript3 source code

/**
 * Copyright doiiob5555 ( http://wonderfl.net/user/doiiob5555 )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/719Q
 */

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
	 creationComplete="init()" backgroundColor="0xffffff" viewSourceURL="srcview/index.html">
<mx:Script>
<![CDATA[

//初期化関数
private function init():void{

	//パーリンノイズ用画像作成
	var bmp_data : BitmapData = new BitmapData( 128 , 128 , true , 0xFFFF8000);
	var offset:Array = [
		new Point(0,0),
		new Point(0,0),
	];	
	var rand:Number = Math.floor(Math.random() * 0xFFFF);
	
	this.addEventListener(Event.ENTER_FRAME ,function (e:Event):void{
		//x.yにちょい移動させる
		offset[0].x += 1;
		offset[1].y += 3;
		//パーリンノイズ作成
		bmp_data.perlinNoise(32 ,128 , 2 , rand , false , true , (8|4|2|1) , false , offset);
		myImage.source = new Bitmap( bmp_data );
	});
}		
]]>
</mx:Script>
<mx:Image id="myImage" x="34" y="21" width="512" height="512"/>
</mx:Application>