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

forked from: forked from: forked from: flash on 2010-3-12

Get Adobe Flash player
by aass 12 Mar 2010
    Embed
/**
 * Copyright aass ( http://wonderfl.net/user/aass )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/9uDi
 */

// forked from aass's forked from: forked from: flash on 2010-3-12
// forked from aass's forked from: flash on 2010-3-12
// forked from aass's flash on 2010-3-12
package {
    import flash.display.Sprite;
    import flash.display.BitmapData;
    import flash.display.Bitmap;
    import flash.display.BitmapDataChannel;
    import flash.geom.Point;
    import flash.events.Event;
    
    [SWF(width=465,height=465,backgroundColor=0)]
    import flash.system.IME;
    public class FlashTest extends Sprite {
    		private var bmpdata:BitmapData;
        public function FlashTest() {
            // write as3 code here..
            //BitmapDataを作成して表示リストに追加
            bmpdata = new BitmapData(120,120,false,0);
            var bmp:Bitmap = new Bitmap(bmpdata);
            bmp.scaleX = bmp.scaleY = 4;
            addChild(bmp);
            //イベント
            addEventListener(Event.ENTER_FRAME,enterframe);
        }
        private var baseX:Number = 60;
        private var baseY:Number = 60;
        private var octaves:uint = 3;
        private var randomSeed:int = Math.random()*0xffffffff;
        private var stitch:Boolean = false;
        private var fractalNoise:Boolean = false;
        private var channelOptions:int = BitmapDataChannel.RED|BitmapDataChannel.BLUE;
        private var grayScale:Boolean = false;
        private var offset:Array = [new Point(),new Point(),new Point()];
        
        private function enterframe(e:Event):void{
        		//PerlinNoise
        		bmpdata.perlinNoise(baseX,baseY,octaves,randomSeed,stitch,fractalNoise,channelOptions,grayScale,offset);
        		offset[0].y += 2;
        		offset[1].y += 1;
        		offset[2].y += 0.5;
        }
    }
}