Color clicking problem

I am making a small flash movie that is supposed to let users click on a color from a selection of colors and apply that color to a particular square on a grid full of squares. I’m making this for a guy’s business webpage (he lays tile flooring) and REALLY need some help. :-\ I’m not the greatest with actionscript and sort of got stuck into doing this job without any choice (don’t ask).

So, so far I have a selection of colors at the top of the screen and have all the code and things neccesary for this to work right, as I have learned from a tutorial. The tutorial is a coloring book tutorial I found on google. I don’t have any links or code examples right now because I’m at work. But so far I can click on a color and click on a square and the tile color changes, though so does everything else change (color selections and other squares). Why does it all change? I will try to supply my .fla file later but was wondering if anyone knew what was going on at first glance. K, thanks! :smiley:

Berdwin

You should have the color pads as movie clips and then use hitTarget. Once they hit on the active area of the mc you can setProperty of the color for the area which you want to change the color.

Hope I did not confuse and hope this helps!!

Ok, here is the .fla file… perhaps someone could look at it? I am in desparate need! :frowning: :slight_smile:

thanks a bunch…

berdwin

ps… srinivas: that kind of made sence but not a lot :S

Your problem is this line:

iColor = new Color( this );

It is inside your button. So this refers to… the _root. Yes, you’re telling the _root to go red. To solve that problem, you should put all your buttons inside movie clips. That way it will work. Or if you’re using MX, use directly movie clips, or if you really want to use buttons, use buttons with instance names and assign them dynamic event handlers.

Cheers.

pom :slight_smile:

=) =) =)

AWESOME!!! it works great now! Thank you SO much. I can now sleep. :beam:

berdwin