# Random Color hex display

**URL:** https://forum.kirupa.com/t/random-color-hex-display/37934
**Category:** Uncategorized
**Created:** [December 16, 2003, 4:55am UTC](https://forum.kirupa.com/t/random-color-hex-display/37934 "2003-12-16T04:55:40Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![macneilslt](https://avatars.discourse-cdn.com/v4/letter/m/aeb1de/32.png) [@macneilslt](https://forum.kirupa.com/u/macneilslt)
#### Post date: [December 16, 2003, 4:55am UTC](https://forum.kirupa.com/t/random-color-hex-display/37934/1 "2003-12-16T04:55:40Z")

</div>

I have a button that changes the RBG of an object like this:  
[AS]  
on(release) {  
myColor = Math.round( Math.random()\*0xFFFFFF );  
myColoredObject = new Color (\_root.square);  
myColoredObject.setRGB(myColor);

}

[/AS]

how can i make it so it displays the hex number for the color in a dynamic text box?
