Color.setRGB()
- Started
- Last post
- 3 Responses
- unclesize
Hi I have a problem with this script. From XML I have a node who's attribute is a hex color.
so when it is read in it looks like this:
swatchHex[i] = xmlNode.firstChild.nodeValue;
I can trace it and get the proper info to the output panel.
However when I call the color object, the syntax breaks.
proper syntax to setRGB is written like this:
my_color.setRGB(0xff9933);
but I want the RGB value to be read from XML so that my syntax would look something like this:
my_color.setRGB(0xswatchHex);
I've tried setting this up as a string like: my_color.setRGB(0x + swatchHex);
But no luck, any ideas??
- joyride0
After setRGB(myNewColor)
var myNewColor:Number
it needs to be a number or it will be a mismatch
- tkmeister0
maybe that?
my_color.setRGB("0x" + swatchHex);
- unclesize0
you're right...damn sometimes I get so lost in this shit I forget the simplest things.
thanks guys.