# Button unable to change value in object/class

**URL:** <https://forum.kirupa.com/t/button-unable-to-change-value-in-object-class/276989>\
**Category:** Uncategorized\
**Created:** [December 6, 2008, 2:43am UTC](https://forum.kirupa.com/t/button-unable-to-change-value-in-object-class/276989 "2008-12-06T02:43:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ayumilove](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ayumilove/32/2532_2.png) [@ayumilove](https://forum.kirupa.com/u/ayumilove)\
**Post date:** [December 6, 2008, 2:43am UTC](https://forum.kirupa.com/t/button-unable-to-change-value-in-object-class/276989/1 "2008-12-06T02:43:28Z")

</div>

hi guys

i have created a character.as class that links to an object sitting on the stage.  
This class i have initialize var name;

i have created a button that uses on(release){}

the problem im having is, my button does not change the value inside the object.

for example:

my object has a variable called ‘name’ that holds the value “ayumilove”

and the button on the stage (once click and release) would change that name to “123”

i did 2 traces, before and after.  
the before trace is “ayumilove”, and after trace is “123”  
However, after i click again (the 2nd time) , it still shows “ayumilove” then “123”  
shouldn’t it be “123” and then “123” ?  
This shows that the name is not renamed, but overwrite back by the default value in the object.

How do i solve this?
