# Simple AS3 question

**URL:** <https://forum.kirupa.com/t/simple-as3-question/273643>\
**Category:** flash\
**Created:** [October 17, 2008, 10:53pm UTC](https://forum.kirupa.com/t/simple-as3-question/273643 "2008-10-17T22:53:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hotcayle](https://avatars.discourse-cdn.com/v4/letter/h/f14d63/32.png) [@hotcayle](https://forum.kirupa.com/u/hotcayle)\
**Post date:** [October 17, 2008, 10:53pm UTC](https://forum.kirupa.com/t/simple-as3-question/273643/1 "2008-10-17T22:53:47Z")

</div>

I am trying to make a button click change a variable …just learning about as3 and this will help me solve a bigger problem.

why does it not work

> var varOne = “test”;

stop();

btnOne.addEventListener(MouseEvent.CLICK, click);

function click(evt:MouseEvent):void {  
varOne = “sheep go bhaa”;  
}

theCode.text = varOne;

in this is very rough code as i have no clue what I am doing
