An Example: The Lights Out Game

This tutorial was created by James Hamblin of Shippensburg University. James is a friend of The applet below contains the well-known Lights Out game. Since the number of squares is generated randomly at runtime, the event listeners attached to the squares have to be created at runtime. The listeners are similar for each square but not identical.


Download the 'fla' file corresponding to the applet.

On the next page, James discusses in detail the code behind the applet.

Note: James Hamblin is an Associate Professor of Mathematics at the Shippensburg University, PA. You can find more of his Flash applets at

Back to Intermediate Tutorials              Back to Flash and Math Home

We welcome your comments, suggestions, and contributions. Click the Contact Us link below and email one of us.

Adobe®, Flash®, ActionScript®, Flex® are registered trademarks of Adobe Systems Incorporated.