I made my own rendition to AS3:Cookbook example of Perlin Noise, an effect created for Tron believe it or not.
Actionscript:
-
package {
-
import flash.display.Sprite;
-
import flash.display.Bitmap;
-
import flash.display.BitmapData;
-
import flash.events.Event;
-
import flash.geom.Point;
-
import flash.display.BitmapDataChannel;
-
-
public class Clouds extends Sprite
-
{
-
private var _bitmap:BitmapData;
-
private var _xoffset:int = 0;
-
private var _w:Number
-
private var _h:Number
-
-
public function Clouds(w:Number, h:Number)
-
{
-
_w = w;
-
_h = h;
-
_bitmap = new BitmapData(_w, _h, true, 0xffFFFFFF);
-
var image:Bitmap = new Bitmap(_bitmap);
-
image.x = image.y = 0;
-
addChild(image);
-
addEventListener(Event.ENTER_FRAME, onEnterFrame);
-
-
}
-
-
public function onEnterFrame(event:Event):void
-
{
-
_xoffset++;
-
var point:Point = new Point(_xoffset, 0);
-
-
_bitmap.perlinNoise(200, 100, 2, 1000, true, true, 8, true, [point, point]);
-
}
-
}
-
}
Last 5 posts in actionscript
- Using Flash Player 10 to produce Dynamic Musical Notes - May 20th, 2008
- Flash Player 10 Dynamic Sound Generation - May 20th, 2008
- How to compile and examples for Flash Player 10 or ASTRO BETA - May 16th, 2008
- How to use Bitmap and BitmapData in ActionScript 3 - v2 - April 23rd, 2008
- How to use Bitmap and BitmapData in ActionScript 3 - v1 - April 21st, 2008
Last 5 posts in as3
- Flash Player 10 Pure Flash Keyboard using SampleDataEvent - September 3rd, 2008
- Using Flash Player 10 to produce Dynamic Musical Notes - May 20th, 2008
- Flash Player 10 Dynamic Sound Generation - May 20th, 2008
- How to load Pixel Bender in Flash Player 10 - May 19th, 2008
- How to compile and examples for Flash Player 10 or ASTRO BETA - May 16th, 2008
Josh Weatherspoon, A self-proclaimed millionaire who for some reason has to work as a Flash Developer, at Travelocity in Dallas(Southlake), TX.
Sorry, no comments yet.