a quite simple problem in fact… …but can’t get rid of !
I parse a file from which I fetch String variables representing Hexadecimal values, in order to use them as RGB color codes.
How to convert these Strings into Hexadecimal values ?
For example, I load a variable with the value “0xFFFFFF” from a file. This varaible is a String. I want to use the value in a SetRGB function, but it can not handle String, and can’t do the conversion itself. So, how can make such a conversion ?
my_color.setRGB(“0xRRGGBB”) does not work.
I need my_color.setRGB(0xRRGGBB).
hum…
well, a s far as I knew, parseInt returns an integer value, not an hexadecimal. And functions like SetRGB requires an numeric hexadecimal value, don’t they ?
tell me wheter I’m wrong but,
if I wrote parseInt(“0x0000FF”, 16), I’ll get 255. WHat I need to get is 0x0000FF, as a numeric hexadecimal value.
well, it seems the setRGB functions can handle integer values…
I should have made this test before asking my stupid questions
I was misguided by the flash documentation that always talk about hexadecimal values in its examples.
Anyway, thxx for your answer, cause parseInt does the job well, and now my work… works !
hexidecimal IS an integer. Its just a different format of writing it. Instead of using units of 10 per decimal place, it uses 16, hense the extra 6 letters used to write it. Even so, the value represented is no different than numbers which can be written in base 10.