# Variables in actions

**URL:** <https://forum.kirupa.com/t/variables-in-actions/152173>\
**Category:** flash\
**Created:** [June 21, 2005, 8:54pm UTC](https://forum.kirupa.com/t/variables-in-actions/152173 "2005-06-21T20:54:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![unchew](https://avatars.discourse-cdn.com/v4/letter/u/7ba0ec/32.png) [@unchew](https://forum.kirupa.com/u/unchew)\
**Post date:** [June 21, 2005, 8:54pm UTC](https://forum.kirupa.com/t/variables-in-actions/152173/1 "2005-06-21T20:54:51Z")

</div>

I don’t know if I will be able to explain this properly, but what I want to know is if my actions can contain variables in something like: _root.my\_mc._(“variable”)…

What I want to do is a game, were you have controls and move you character with your arrows… but when i use the hittest, it makes the character bounce “.\_x” and I want it to change according on where the character is moving.

If for example I press the “up” button, the character will move and the variable “direction” will change from “.\_x” to “.\_y” so that the hittest action changes the bounce direction.

What actionscript should I use to change that property?

Thanks in advance!

😛
