# Change color of dynamic button

**URL:** <https://forum.kirupa.com/t/change-color-of-dynamic-button/164832>\
**Category:** flash\
**Created:** [October 5, 2005, 9:49am UTC](https://forum.kirupa.com/t/change-color-of-dynamic-button/164832 "2005-10-05T09:49:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![superprg](https://avatars.discourse-cdn.com/v4/letter/s/858c86/32.png) [@superprg](https://forum.kirupa.com/u/superprg)\
**Post date:** [October 5, 2005, 9:49am UTC](https://forum.kirupa.com/t/change-color-of-dynamic-button/164832/1 "2005-10-05T09:49:19Z")

</div>

I created buttons using this code(from the library)

\_root.lines.attachMovie(“Button”, “button”+i+p1+p2,i+p1+p2);  
\_root.lines[“button”+i+p1+p2].\_height = 10;  
\_root.lines[“button”+i+p1+p2].\_width = 10;  
\_root.lines[“button”+i+p1+p2].\_x = posx\*;  
\_root.lines[“button”+i+p1+p2].\_y = posy\*;  
// \_root.lines[“button”+i+p1+p2].\_RGB=(0x00ff00);  
//\_root.lines[“button”+i+p1+p2].color= “#176C34”;  
\_root.lines[“button”+i+p1+p2].backgroundColor = 0xFF0000;  
\_root.lines[“button”+i+p1+p2].color = 0x0000FF;  
\_root.lines[“button”+i+p1+p2].textColor = 0xFFFFFF;  
I am not able to figure out how I can change the coor of the button dynamically  
Can anyone help please?
