Log in

View Full Version : changing object color with xml



da_mascus
07-17-2009, 10:18 AM
hi guys.
i am kinda new to flash and never used xml actually :)
the problem is that I promised mine GF that I'll help her with her schoolproject. they are going to have a map with cetain areas, that should have on of tree colors depending on what the XML file says about them:

what I need to do is:
I will have like 10 square objects in my flash movie each with its own unique instance name. somewhere in the movie there will be defined 3 variables
each representing a color, for example:

1 = #000
2 = #FFF
3 = #EEE

and in the XML file there will be the list of the object names and to each of them will be a value that i can change from 1 to 3 and the color of the objects will change in the flas movie.

could please anyone show me how to do this, as I see it it should be done fast, but I was not able to make it work. I tried googling but nothing that would help my case came up. Thank you very much in advance !

da_mascus
07-18-2009, 06:00 PM
hmm no response
looking back maybe what I wrote looks complicated.

to put it simple all I need to know is: "how can I set the color of an flashobject through a XML file ?

for example you draw a shape in flash, how can I make the color red with xml ? please anyone ?

punstc
07-20-2009, 02:48 PM
Have you looked into the colorTransform class? I've never actually used it myself for any real example other then playing around, but it should help you with what your trying to do.

da_mascus
07-20-2009, 04:53 PM
well no I didnt. xml isn't familiar to me. would you have any example ? thanks