forked from: forked from: petal
/**
* Copyright teageek ( http://wonderfl.net/user/teageek )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/nuBz
*/
// forked from teageek's forked from: petal
// forked from k3lab's petal
package {
import flash.display.Sprite;
import flash.events.Event;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.utils.getTimer;
import flash.geom.ColorTransform;
public class FlashTest extends Sprite {
private var canvas:BitmapData
private var color:ColorTransform = new ColorTransform(1, 1, 1, 1, -50, -35*5, -15);
public function FlashTest() {
canvas = new BitmapData(480, 480, false,0);
addChild(new Bitmap(canvas)) as Bitmap;
addEventListener(Event.ENTER_FRAME, update);
}
private function update(e:Event):void {
var a:Number = Math.sin( getTimer() / 1000000 ) * 1000000;
canvas.lock();
//canvas.fillRect(canvas.rect,0);
canvas.colorTransform(canvas.rect, color);
for(var i:int = 0; i < 10000; i++) {
var r:Number = 100+150 + 40 * Math.sin( a/1000 * 1.5 )+
120 * Math.sin( i*2 * Math.cos(a/1500000) + a/10000 ) ;
// canvas.setPixel(240 + r * Math.sin(i / 160), 240 + r * Math.cos(i / 160),0xff);
canvas.setPixel(240 + r * Math.sin(i / 160), 240 + (r-10)* Math.cos(i / 200),0xff);
}
canvas.unlock();
}
}
}