Hello all.

I am having to create a game in flash for a uni project, we are using Cs5, and must use AS3.

This is the first time I have used flash so I am very new to it all.

In my game I have 6 targets, above each target is a light that comes on randomly.

I need to run a test when a target is clicked on to see if the light above it is visible.

I have it working but I really dislike the way I have done it, so looking for a better way.

At the moment each target is name "target1" to "target6" and the lights are named "light1" to "light6". So when target1 is hit it gets the name replaces target with light and checks to see if that light is visible, this relies on them being named a certain way.

I thought about maybe having both the target and the light in one movie clip symbol, on frame one just the target, on frame two the target and the light.

When the movie clip is clicked it checks to see what frame its on, if its on 2 then the score is increased if its on frame 1 then its not increased.

Another way I considered was to use two arrays, one for lights one for targets. Add them in the same order from left to right or something like that. So when I click on a target it gets the index of it from the array then uses that index to get the corresponding light from the other array and checks to see if its visible.

Just wondering if someone can give me some guidance on which method is best or if there is another method that would work better.

Thanks in advanced for any help and if you need more information please just ask.

Tom.