home page icon Flash Bestiary / BASICs / Random Pixels x 4

Random Pixels x 4

This is a simple modification of the last program which creates a kind of rudimentary 4-way kaleidoscopic effect.

In the last program, for each pixel, we computed a random color c, and a random set of 2D coordinates x and y. In this program, we use this information to paint 4 pixels of the same color at the following positions:

width-x, y
x, height-y

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 Checkers

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