# Accessing Variables

**URL:** <https://forum.kirupa.com/t/accessing-variables/311081>\
**Category:** flash\
**Created:** [June 27, 2010, 6:24am UTC](https://forum.kirupa.com/t/accessing-variables/311081 "2010-06-27T06:24:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Petrie](https://avatars.discourse-cdn.com/v4/letter/p/7ba0ec/32.png) [@Petrie](https://forum.kirupa.com/u/Petrie)\
**Post date:** [June 27, 2010, 6:24am UTC](https://forum.kirupa.com/t/accessing-variables/311081/1 "2010-06-27T06:24:58Z")

</div>

Hey everyone 🙂

Okay so I’m making a simple turn-based battle system like in FF1/2 using AS3

I was wondering if I made another .as file with all the variables for the stats, like HP MP attack defense etc, could I then access those variables in the main document class? If so, how would I access, for example, the variable HP in the main doc class?

I tried google and looking here on the forums but I must be searching the wrong key terms or something. /noob :puzzled:

Hopefully this makes sense. I’m still have a lot to learn about AS3 T\_T.

Thanks to anyone that helps.

Edit: this is what i have so far if anyone is interested 😛

[http://dl.dropbox.com/u/370336/RPG%20Battle2.swf](http://dl.dropbox.com/u/370336/RPG%20Battle2.swf)
