I ran across a similar problem for an application I worked on in
Actionscript 2. I had a very large image broken into 10x10 tiles. Each
tile related to an image and some data. Instead of drawing a pile of
boxes (or rectangles) as MovieClips, I created a Bitmap drawing that
had all the tiles I needed on it (so in effect, it looked like a bunch
of individual movieclips). I then created an associative array that
stored the class instances I needed that correlated with each tile on
the drawing, based on an x-y position (ie array['0-0'] = instance1;
array['10-0'] = instance2, etc). I registered the mouse and click
events against the movieclip that had the bitmap in it. As the user
moved across or clicked on the bitmap I had a simple function that
would calculate the tile that user had moused over or clicked on, find
the necessary instance in array and then do the work that need to be
done. It worked super fast, since the application was not bogged down
with thousands of movieclips.

Derrick Grigg
--------------
www.dgrigg.com

Reply via email to