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

**URL:** https://forum.kirupa.com/t/flash8-how-to-convert-from-a-string-to-hexadecimal-value/179452
**Category:** flash
**Created:** [February 20, 2006, 11:14am UTC](https://forum.kirupa.com/t/flash8-how-to-convert-from-a-string-to-hexadecimal-value/179452 "2006-02-20T11:14:47Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![darth](https://avatars.discourse-cdn.com/v4/letter/d/71c47a/32.png) [@darth](https://forum.kirupa.com/u/darth)
#### Post date: [February 20, 2006, 11:14am UTC](https://forum.kirupa.com/t/flash8-how-to-convert-from-a-string-to-hexadecimal-value/179452/1 "2006-02-20T11:14:47Z")

</div>

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!
