[Flash8]how to convert from a string to hexadecimal value?

HI!

I want to ues XML to make various things dynamic in a site, including different background colors. XML values are always as strings and I cannot seem to find how to convert from the string to hexadecimal number that is needed to ues the setRGB function.

trace(this.bg_color)//1a2221
var colornumber = “0x”+this.bg_color
trace(colornumber)//0x1a2221
colornumber = Number(colornumber)
trace(colornumber)//1712673
backgr.setRGB(colornumber)// nothing happens

Please Help!