crescue
asked on
change background color with actionscript in flash
Hi, how can I change the background color of a square (it could be a button, movieclip or graphic).
Here is what I want to do. I have created 20 squares with numbers (from 1 to 20), and when the user clicks on a square, it will change its background color. This has to be done with actionscript because I want to be able to save the changed background squares (I will take care of that later)
Thanx for any input
Here is what I want to do. I have created 20 squares with numbers (from 1 to 20), and when the user clicks on a square, it will change its background color. This has to be done with actionscript because I want to be able to save the changed background squares (I will take care of that later)
Thanx for any input
What version of Actionscript do you plan to use ?
ASKER
AS2, and I am getting unexpected file format
I am using CS3
Thanx
I am using CS3
Thanx
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
can you know the color of the tile before changing it ?
(to know which color is was beforehand)
Thanx ur solution works as expected ! :)
(to know which color is was beforehand)
Thanx ur solution works as expected ! :)
ASKER
I've requested that this question be closed as follows:
Accepted answer: 0 points for crescue's comment http:/Q_27189334.html#36162836
for the following reason:
Great !!!
Accepted answer: 0 points for crescue's comment http:/Q_27189334.html#36162836
for the following reason:
Great !!!
ASKER
I made a mistake while pressing to AWARD the earned points to QUIZENGINE
QUIZENGINE solution was perfect !!!
I cannot find how to cancel MY error !!!
QUIZENGINE solution was perfect !!!
I cannot find how to cancel MY error !!!
ASKER
can you know the color of the tile before changing it ?
(to know which color is was beforehand)
Thanx ur solution works as expected ! :)
(to know which color is was beforehand)
Thanx ur solution works as expected ! :)
Thanks for the award, but I'm unclear if you still need some clarification - do you, and if you do what is it that you need explaining ?
ASKER
Everything is working great. My only OTHER question was : If I can know in advance which color the TILE was. For examle if it was purple, red, yellow, etc... BEFORE changing the color
Thanx
Thanx
It is possible to 'sample' the colour in a shape using actionscript, but it is a bit complex.
I would say that it is far easier to create an array that holds the initial colours, and then whenever the colour gets changed, just update the array as well.
I would say that it is far easier to create an array that holds the initial colours, and then whenever the colour gets changed, just update the array as well.