# Variable Issue

**URL:** <https://forum.kirupa.com/t/variable-issue/309894>\
**Category:** Uncategorized\
**Created:** [May 27, 2010, 2:33am UTC](https://forum.kirupa.com/t/variable-issue/309894 "2010-05-27T02:33:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![GexetGuy](https://avatars.discourse-cdn.com/v4/letter/g/2acd7d/32.png) [@GexetGuy](https://forum.kirupa.com/u/GexetGuy)\
**Post date:** [May 27, 2010, 2:33am UTC](https://forum.kirupa.com/t/variable-issue/309894/1 "2010-05-27T02:33:51Z")

</div>

I want to have a variable which changes from time to time based on certain parameters.

For Example:

* * *

var poop:Number;

onEnterFrame = function(){[INDENT]if(donkey==1){  
[/INDENT][INDENT][INDENT]poop = 2;  
[/INDENT][/INDENT][INDENT]}

if(donkey==2){[INDENT]poop = 5;  
[/INDENT]}

[/INDENT]}

* * *

But it doesn’t work. I can’t seem to change the value of “poop” with code. It only accepts a value that I place, ex. var poop = 2, but that doesn’t let me change it.

This is Flash MX, BTW
