# Loop over dynamic text box?

**URL:** <https://forum.kirupa.com/t/loop-over-dynamic-text-box/21832>\
**Category:** Uncategorized\
**Created:** [May 27, 2003, 1:06am UTC](https://forum.kirupa.com/t/loop-over-dynamic-text-box/21832 "2003-05-27T01:06:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeyyu](https://avatars.discourse-cdn.com/v4/letter/j/e68b1a/32.png) [@jeyyu](https://forum.kirupa.com/u/jeyyu)\
**Post date:** [May 27, 2003, 1:06am UTC](https://forum.kirupa.com/t/loop-over-dynamic-text-box/21832/1 "2003-05-27T01:06:58Z")

</div>

Hi Guys:  
How do I loop some text over a dynamic text box.

I have a dynamic text box called (dyntext). I have a button below that Says “Click Here” or something to that effect.

Now, when I Click on the button, I have some code like

var i  
for(int i=0;i\<25;i++) {  
dyn.text=“this is a test”;  
}

but no dice. it only writes it once. not the 25 times like I want. it works in trace(“message”) but why not in a dynamic text box.

thanks guys.

jeyyu.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 27, 2003, 1:17am UTC](https://forum.kirupa.com/t/loop-over-dynamic-text-box/21832/2 "2003-05-27T01:17:13Z")

</div>

you’ll need to use the ‘+=’ operator…

```auto
for(int i=0;i<25;i++) {
dyn.text += "this is a test";
}

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 27, 2003, 2:01am UTC](https://forum.kirupa.com/t/loop-over-dynamic-text-box/21832/3 "2003-05-27T02:01:22Z")

</div>

Thanks Ahmed:  
That works!!!. how could I forget that after cs progz. doh!!. and just to the other folks readin this.  
if u want to put in a new line character. just add  
to the end of the string.  
for(…) {  
dyntext.text+="this is a text  
";  
}

Thanks Guys.

Jayc.
