# Public Variables in Functions Acting Like Within Classes

**URL:** <https://forum.kirupa.com/t/public-variables-in-functions-acting-like-within-classes/319926>\
**Category:** flash\
**Created:** [March 9, 2011, 3:12am UTC](https://forum.kirupa.com/t/public-variables-in-functions-acting-like-within-classes/319926 "2011-03-09T03:12:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![selacius](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@selacius](https://forum.kirupa.com/u/selacius)\
**Post date:** [March 9, 2011, 3:12am UTC](https://forum.kirupa.com/t/public-variables-in-functions-acting-like-within-classes/319926/1 "2011-03-09T03:12:22Z")

</div>

I am trying to figure out how to setup a function that has variables within it that may be called from other classes. The best way to describe this is to setup a scenario.  
I have a Game\_Party class which handles everything as it relates to the members within the heros party. One of the functions (Members(id)) I would like to use to access the array which holds the active\_party for a specific member (Members(1) refers to \_active\_party(1)). Now within this function Members, I would like to be able to have various other variables which pull specific data from the \_active\_party array. So if I go Members(1).alias then the alias or name of the member being accessed is displayed. How best can I do this? I don’t want to set up a new class or anything like that.
