** Lots of dynamic text on the fly **

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 ?

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

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

[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 )

Depth
:slight_smile:

sweet…

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

is there any reason for that ?

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

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

All is clear now… thanx claudio

welcome :thumb: