home page icon Flash Bestiary / BASICs / Random Pixels

Random Pixels

This, the first movie in the bestiary, is based on a simple BASIC program I wrote many times on different early-80s computers such as Commodore Vic-20, and TRS-80. The following BASIC source code shown here is for the TRS-80, and you can try it out on a TRS-80 simulator, such as this one.

10 COLOR RND(15)
20 SET(RND(20),RND(20))
30 GOTO 10

On these old-computers, the pixels are so large, that they look like blocks. On modern computers, pixels are small, so to simulate the effect, you have to draw random rectangles or blocks, each of which comprises many pixels.

This flash movie, a 603 byte file (less than 1 Kb), is a good example of the efficiency that can be achieved by using pure actionscript.

UPDATE: The source code below now contains an Actionscript 3 version, and a Flash 8 (bitmapped) version, in addition to the original Flash MX code.


sourcecode iconDownload the flash project
book iconJim's Favorite Actionscript Books
wiki iconAsk Jim about Actionscript
Next: Random Pixels x 4

Having trouble opening the project? You may need to Upgrade to Flash MX 2004

Copyright © 2003,2004 by Jim Bumgardner. All Rights Reserved.        Leave Jim some feedback