How to Create TV Static in Flash

How to Create TV Static in Flash thumbnail
Create television static in Flash.

On old TVs, when the cable was not coming in for certain channels, static would appear. The static is simply thousands of white and black dots moving around according to a "noise" function that constantly gives new random values for the dots' positions. This effect can be replicated nicely in Flash using an ActionScript that animates a movie clip according to a noise function.

Instructions

    • 1

      Open Flash. Go to "File," "New," and create a new file of type "Flash File (Actionscript 2.0)".

    • 2

      Hit "R" on your keyboard to use the "Rectangle" tool. Click and drag on the stage to create the rectangle that will contain your TV static. Don't worry about the color--it won't show up when you test your movie.

    • 3

      Hit "V" on your keyboard to use the "Selection" tool. Second-click the square you just drew and select "Convert to Symbol..." Call the Symbol "tv_mc".

    • 4

      Click the square. On the right toolbar, in the "Properties" window, type "tv_mc" where it says "<Instance Name>".

    • 5

      Create a new layer by clicking the "New Layer" button on the bottom-left corner of the time line.

    • 6

      Click the blank key frame in your new layer and select "Actions" to bring up the Actions window.

    • 7

      In the Actions window, copy-paste the following ActionScript code:
      this.createEmptyMovieClip("tv_static", 1);
      tv_static._x = tv_mc._x;
      tv_static._y = tv_mc._y;
      var bitmap_data = new flash.display.BitmapData(tv_mc._width, tv_mc._height);
      tv_static.attachBitmap(bitmap_data, 1);
      tv_static.setMask(tv_mc);
      onEnterFrame = function(){
      bitmap_data.noise(Math.floor(1000*Math.random()), 0, 255, 1|2|4, true);
      }

    • 8

      Click "Control," "Test Movie" to test your movie. Where your square was, you will see animated black and white TV static.

Related Searches:

References

  • Photo Credit old television image by inacio pires from Fotolia.com

Comments

You May Also Like

Related Ads

Featured