PerlinNoise animation
package {
import flash.display.BitmapData;
import flash.display.Bitmap;
import flash.display.Shape;
import flash.display.Sprite;
import flash.utils.Timer;
import flash.events.TimerEvent;
import flash.geom.Point;
public class Main extends Sprite {
private var _bitmapData:BitmapData = new BitmapData(200, 200);
private var _offset:Number = 0;
public function RuntimeBitmap() {
var bitmap:Bitmap = new Bitmap(_bitmapData);
addChild(bitmap);
var timer:Timer = new Timer(1000);
timer.addEventListener(TimerEvent.TIMER, timerHandler);
timer.start();
}
private function timerHandler(event:TimerEvent):void {
_bitmapData.perlinNoise(100, 100, 1, 1, false, false, 1, false, [new Point(_offset++, 0)]);
}
}
}
Related examples in the same category