# \*\* Lots of dynamic text on the fly \*\*

**URL:** <https://forum.kirupa.com/t/lots-of-dynamic-text-on-the-fly/29025>\
**Category:** flash\
**Created:** [August 21, 2003, 8:11am UTC](https://forum.kirupa.com/t/lots-of-dynamic-text-on-the-fly/29025 "2003-08-21T08:11:53Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![The\_Vulcan](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/the_vulcan/32/145_2.png) [@The\_Vulcan](https://forum.kirupa.com/u/The_Vulcan)\
**Post date:** [August 21, 2003, 8:11am UTC](https://forum.kirupa.com/t/lots-of-dynamic-text-on-the-fly/29025/1 "2003-08-21T08:11:53Z")

</div>

How would one go about this ?

say you have a number of input text fields. and ppl feed their orders in.

big mac = 5  
mc chicken = 2  
lg coke = 0  
fillet of fish = 0  
cookies = 0  
sunday = 2

then once they are done it shows thier order… without all the menu items.

big mac = 5  
mc chicken = 2  
sunday = 2

To do this I was going to attempt to have an if statement for each item.

if there was an item ordered a dynamic text box would be created at \_x \_y… then add 10 to \_x. (to move the next one down the stage)

if there was no item ordered a dynamic text box would not created.

then the next item would be created further down the page as \_x was increased with the last menu item created.

So is this the only way to go about creating this, or is there a better way ?

---

<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:** [August 21, 2003, 8:14am UTC](https://forum.kirupa.com/t/lots-of-dynamic-text-on-the-fly/29025/2 "2003-08-21T08:14:16Z")

</div>

Since you already have an idea on how to do it with the \_x and \_y, here’s a tutorial you can use for displaying the orders:

[http://www.kirupa.com/developer/flash5/displayingtextfield.htm](http://www.kirupa.com/developer/flash5/displayingtextfield.htm)

---

<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:** [August 21, 2003, 8:49am UTC](https://forum.kirupa.com/t/lots-of-dynamic-text-on-the-fly/29025/3 "2003-08-21T08:49:57Z")

</div>

Thanks for that…

I have that tute saved to my drive already…

I was gonna try something like this when I get a chance. { thanx Kax }  
[http://www.kirupaforum.com/forums/showthread.php?s=&threadid=31224](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=31224)

[AS]  
x\_position = 0;

if(big mac != 0){

// create TextFields(label | ? | Y | x\_position | length | height )  
this.createTextField(“big mac”, 0, 0,x\_position , 80, 16);  
// set text format  
big mac.setNewTextFormat(new TextFormat(“Verdana”, 10));  
// set TextField type to input  
big mac.type = “dynamic”;  
// admit characters only from 0 to 9 and .  
big mac.restrict = “0-9.”;  
// show TextField border  
big mac.border = true;  
// call function  
big mac.onChanged = addition;

x\_position = x\_position + 10;  
}  
[/AS]

oh, and what is the ? section in the  
TextFields(label | ? | Y | X | length | height )

---

<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:** [August 21, 2003, 1:48pm UTC](https://forum.kirupa.com/t/lots-of-dynamic-text-on-the-fly/29025/4 "2003-08-21T13:48:57Z")

</div>

Depth  
🙂

---

<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:** [August 21, 2003, 6:35pm UTC](https://forum.kirupa.com/t/lots-of-dynamic-text-on-the-fly/29025/5 "2003-08-21T18:35:28Z")

</div>

sweet…

in Kax’s example he sets up each new text field on a new layer.

is there any reason for that ?

---

<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:** [August 21, 2003, 6:45pm UTC](https://forum.kirupa.com/t/lots-of-dynamic-text-on-the-fly/29025/6 "2003-08-21T18:45:23Z")

</div>

You mean depth right?  
He sets each textfield on an unique depth level otherwise the second will replace the first one.

```auto
this.createTextField("a_txt", **0** , 0, 0, 80, 16);
this.createTextField("b_txt", **0** , 100, 0, 80, 16);//"b_txt" will replace "a_txt" since im creating both on same depth level

```

---

<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:** [August 22, 2003, 6:42am UTC](https://forum.kirupa.com/t/lots-of-dynamic-text-on-the-fly/29025/7 "2003-08-22T06:42:47Z")

</div>

All is clear now… thanx claudio

---

<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:** [August 22, 2003, 2:40pm UTC](https://forum.kirupa.com/t/lots-of-dynamic-text-on-the-fly/29025/8 "2003-08-22T14:40:34Z")

</div>

welcome :thumb:
