# How to set property to a dynamic button?

**URL:** <https://forum.kirupa.com/t/how-to-set-property-to-a-dynamic-button/197410>\
**Category:** Uncategorized\
**Created:** [August 16, 2006, 3:16am UTC](https://forum.kirupa.com/t/how-to-set-property-to-a-dynamic-button/197410 "2006-08-16T03:16:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![skyp](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/skyp/32/2681_2.png) [@skyp](https://forum.kirupa.com/u/skyp)\
**Post date:** [August 16, 2006, 3:16am UTC](https://forum.kirupa.com/t/how-to-set-property-to-a-dynamic-button/197410/1 "2006-08-16T03:16:37Z")

</div>

Hello, friends

some code look like this:

```
var i = 1;
while(i &lt; 6){
    newX = new Number(i * 25);
    newY = new Number(187);
    newW = new Number(22);
    newH = new Number(22);
    _root.createClassObject(mx.controls.Button, "button"+i, i, {label:i, _x:newX, _y:newY, _width:newW, _height:newH});
    i++;
}

"button"+i.enabled = false;

```

the last line is syntax error, is there any way can I set property to a dynamic variable like above?

or how can I concat a string and a variable as a new variable?

I’d very appriciated if any one can help me out, thanks in advance.

a newbe
