# Changing Value in Text field

**URL:** <https://forum.kirupa.com/t/changing-value-in-text-field/184209>\
**Category:** flash\
**Created:** [April 3, 2006, 10:37am UTC](https://forum.kirupa.com/t/changing-value-in-text-field/184209 "2006-04-03T10:37:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![poletnik](https://avatars.discourse-cdn.com/v4/letter/p/dc4da7/32.png) [@poletnik](https://forum.kirupa.com/u/poletnik)\
**Post date:** [April 3, 2006, 10:37am UTC](https://forum.kirupa.com/t/changing-value-in-text-field/184209/1 "2006-04-03T10:37:52Z")

</div>

Hello again…

I have some value in a dinamic text field and I want to make + and - buttons to change value. This is my code on + button.

temp\_mc.plus\_btn.onPress = function()  
{  
value.text = value.text +1 ;  
}

But this only adds 1 to my text file. For example if my text field is 1 and I click + button I get 11, but I want to get 2.

How can I do that? I tried value.text++ but it doesn’t do anything?

I’m not much of a coder so please help me. 10x

---

<div class="post-metadata">

**Author:** ![pensamente](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/pensamente/32/1208_2.png) [@pensamente](https://forum.kirupa.com/u/pensamente)\
**Post date:** [April 3, 2006, 11:39am UTC](https://forum.kirupa.com/t/changing-value-in-text-field/184209/2 "2006-04-03T11:39:19Z")

</div>

[AS]var textfield = 3;  
mytxt.text = textfield;  
temp\_mc.plus\_btn.onPress = function() {  
textfield += 1;  
mytxt.text = textfield;  
};[/AS]

just named the text field mytxt, u can undo that… hope this help you out

🙂

---

<div class="post-metadata">

**Author:** ![TheCanadian](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@TheCanadian](https://forum.kirupa.com/u/TheCanadian)\
**Post date:** [April 3, 2006, 9:24pm UTC](https://forum.kirupa.com/t/changing-value-in-text-field/184209/3 "2006-04-03T21:24:40Z")

</div>

Or:

```auto
temp_mc.plus_btn.onPress = function() {
 value.text = Number(value.text) + 1;
};

```

---

<div class="post-metadata">

**Author:** ![poletnik](https://avatars.discourse-cdn.com/v4/letter/p/dc4da7/32.png) [@poletnik](https://forum.kirupa.com/u/poletnik)\
**Post date:** [April 4, 2006, 9:03am UTC](https://forum.kirupa.com/t/changing-value-in-text-field/184209/4 "2006-04-04T09:03:40Z")

</div>

Thank’s to both of you… you really helped me a lot.

Now I have a new problem … I want to display value in €, which should be calculated from value of some text field.

My code curently:

skup3.text= Number(skup2.text) / Number(euro.text) + “€”;

In euro.text I have defined value of € in our country…

Why isn’t this working? It’s almost the same code as example above?

---

<div class="post-metadata">

**Author:** ![flextnet](https://avatars.discourse-cdn.com/v4/letter/f/7ba0ec/32.png) [@flextnet](https://forum.kirupa.com/u/flextnet)\
**Post date:** [April 4, 2006, 1:27pm UTC](https://forum.kirupa.com/t/changing-value-in-text-field/184209/5 "2006-04-04T13:27:05Z")

</div>

When you say it doesn’t work, what do you mean? There’s nothing wrong with that code so you must not have valid number text in either skup2.text or euro.text
