TV Static [as3]

Here is senoculars TV Static converted to AS3

original as2 link

import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.BitmapDataChannel;

// create a new movie clip for the static
var static_mc:MovieClip = new MovieClip();

this.addChild(static_mc);

// position the static movie clip with the mask
static_mc.x = mask_mc.x;
static_mc.y = mask_mc.y;

// create a bitmap data instance the size of the mask
// that will be used to draw static in
var _bitmapData = new BitmapData(mask_mc.width, mask_mc.height);
var _bitmap = new Bitmap(_bitmapData)

// attach the bitmap to the static movie clip
static_mc.addChild(_bitmap);

// apply the mask
static_mc.mask = mask_mc;

static_mc.addEventListener(Event.ENTER_FRAME, _static);

// every frame draw static
function _static(e:Event):void
{
    var seed:int = int(Math.random() * int.MAX_VALUE);
    _bitmapData.noise(seed, 0, 0xFFFFFF, BitmapDataChannel.RED, true);
}