Posted By

sidneydekoning on 07/05/10


Tagged


Versions (?)

Who likes this?

6 people have marked this snippet as a favorite

Vordreller
ions
StrawMan
shalomfriss
PixelJuice
tspitzr


Generate TV static in AS3


 / Published in: ActionScript 3
 

Generate snow, like on a TV set.

  1. var tvStatic:MovieClip = new MovieClip();
  2. addChild(tvStatic);
  3.  
  4. var bmpData:BitmapData = new BitmapData(320,240);
  5. var bmp:Bitmap = new Bitmap(bmpData);
  6.  
  7. tvStatic.addChild(bmp);
  8.  
  9.  
  10. addEventListener(Event.ENTER_FRAME,generateStatic, false, 0, true);
  11.  
  12. private function generateStatic(e:Event){
  13. bmpData.noise(Math.floor(100000*Math.random()), 0, 255,0, true);
  14. }

Report this snippet  

You need to login to post a comment.