# \*\*\* Dynamic text \*\*\*

**URL:** <https://forum.kirupa.com/t/dynamic-text/29213>\
**Category:** Uncategorized\
**Created:** [August 24, 2003, 9:25am UTC](https://forum.kirupa.com/t/dynamic-text/29213 "2003-08-24T09:25:24Z")\
**Posts on this page:** 3\
**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 24, 2003, 9:25am UTC](https://forum.kirupa.com/t/dynamic-text/29213/1 "2003-08-24T09:25:24Z")

</div>

This must be something simple… but I dont see the prob ?

the first frame and script works fine. But I the second frame doesn’t.

FIRST FRAME  
[AS]  
f\_pack\_amount = 0;  
s\_pack\_amount = 0;  
t\_pack\_amount = 0;  
oyster\_amount = 0;  
chilli\_amount = 0;  
soya\_amount = 0;  
wasabi\_amount = 0;  
sticks\_amount = 0;  
menus\_amount = 0;  
//\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
f\_pack\_total = 0;  
s\_pack\_total = 0;  
t\_pack\_total = 0;  
oyster\_total = 0;  
chilli\_total = 0;  
soya\_total = 0;  
wasabi\_total = 0;  
del\_total = 10.00;  
order\_total = 0;  
//\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
//\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
\_root.onEnterFrame = function() {

if (isNaN(f\_pack\_amount)) {f\_pack\_amount = 0;}  
if (isNaN(s\_pack\_amount)) {s\_pack\_amount = 0;}  
if (isNaN(t\_pack\_amount)) {t\_pack\_amount = 0;}  
if (isNaN(oyster\_amount)) {oyster\_amount = 0;}  
if (isNaN(chilli\_amount)) {chilli\_amount = 0;}  
if (isNaN(soya\_amount )) {soya\_amount = 0;}  
if (isNaN(wasabi\_amount)) {wasabi\_amount = 0;}  
if (isNaN(sticks\_amount)) {sticks\_amount = 0;}  
if (isNaN(menus\_amount )) {menus\_amount = 0;}

```
f_pack_total = f_pack_amount * 4.00;
s_pack_total = s_pack_amount * 5.40;
t_pack_total = t_pack_amount *19.20;
oyster_total = oyster_amount * .50;
chilli_total = chilli_amount * .50;
  soya_total = soya_amount * .50;
wasabi_total = wasabi_amount * .60;

	  _order = order_total - del_total;

```

order\_total =  
f\_pack\_total +  
s\_pack\_total +  
t\_pack\_total +  
oyster\_total +  
chilli\_total +  
soya\_total +  
wasabi\_total;

if (order\_total - del\_total \> 20) {del\_total = 0;} else{del\_total = 10.00}

order\_total = (order\_total + del\_total);

};  
[/AS]  
SECOND FRAME  
[AS]  
x\_position = 0;

\_root.onEnterFrame = function() {

if(f\_pack\_amount != 0){  
//( label | layer | Y | x\_position | length | height )  
this.createTextField(“f\_pack\_amount”, 0 , 0 , x\_position , 80 , 16 );  
f\_pack\_amount.setNewTextFormat(new TextFormat(“Verdana”, 10));  
f\_pack\_amount.type = “dynamic”;  
f\_pack\_amount.border = true;

```
    x_position = x_position + 10;}

```

}  
[/AS]

---

<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 24, 2003, 8:15pm UTC](https://forum.kirupa.com/t/dynamic-text/29213/2 "2003-08-24T20:15:27Z")

</div>

You already have a variable named _f\_pack\_amount_. Then you are creating a textfield with that same name. Replace it for _f\_pack\_amount\_text_. [AS]this.createTextField(“f\_pack\_amount\_text”, 0 , 0 , x\_position , 80 , 16 );[/AS]

---

<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 24, 2003, 8:27pm UTC](https://forum.kirupa.com/t/dynamic-text/29213/3 "2003-08-24T20:27:59Z")

</div>

And the correct sintax for the MovieClip.createTextField method is as follows:  
[AS]MovieClip.createTextField(instanceName, depth, x, y, width, height);[/AS]  
See? The x parameter is before the y parameter! 😛
