# Changing dynamic text field value via button

**URL:** <https://forum.kirupa.com/t/changing-dynamic-text-field-value-via-button/301139>\
**Category:** flash\
**Created:** [December 3, 2009, 7:43pm UTC](https://forum.kirupa.com/t/changing-dynamic-text-field-value-via-button/301139 "2009-12-03T19:43:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![greatwall](https://avatars.discourse-cdn.com/v4/letter/g/db5fbb/32.png) [@greatwall](https://forum.kirupa.com/u/greatwall)\
**Post date:** [December 3, 2009, 7:43pm UTC](https://forum.kirupa.com/t/changing-dynamic-text-field-value-via-button/301139/1 "2009-12-03T19:43:33Z")

</div>

Hi all

I’m just doing a test for the moment, where iv’e got a dynamic text field and a button. All i want is when the user presses the button, the numerical value of the number displayed in the text field increases by 1.

```
ActionScript Code:
[LEFT]but.[COLOR=#993300]onRelease[/COLOR] = [COLOR=#993300]function[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]

[COLOR=#993300]var[/COLOR] testvar = testvar+[COLOR=#000000]1[/COLOR];

```

[COLOR=#000000]}[/COLOR];  
[/LEFT]

Yeah, i’m a newbie, and of course the above code dosen’t work. Any pointers to get this to succeed?

Many thanks
