forked from: flash on 2009-7-13
forked from flash on 2009-7-13 (diff: 1)
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/viyU
*/
<?xml version="1.0" encoding="utf-8"?>
<!-- forked from doiiob5555's flash on 2009-7-13 -->
<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 , 0xFFFFFFFF);
var offset:Array = [
new Point(1,0),
new Point(0,1),
];
var rand:Number = Math.floor(Math.random() * 0xFFFF55);
this.addEventListener(Event.ENTER_FRAME ,function (e:Event):void{
//x.yにちょい移動させる
offset[0].x += .5;
offset[1].y += .5;
//パーリンノイズ作成
bmp_data.perlinNoise(16 ,64 , 3, rand , true , 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>