# Advanced: Accessing a class's static functions from a variable of type Class

**URL:** <https://forum.kirupa.com/t/advanced-accessing-a-classs-static-functions-from-a-variable-of-type-class/305137>\
**Category:** Uncategorized\
**Created:** [February 19, 2010, 4:40pm UTC](https://forum.kirupa.com/t/advanced-accessing-a-classs-static-functions-from-a-variable-of-type-class/305137 "2010-02-19T16:40:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lovepuppy](https://avatars.discourse-cdn.com/v4/letter/l/8797f3/32.png) [@lovepuppy](https://forum.kirupa.com/u/lovepuppy)\
**Post date:** [February 19, 2010, 4:40pm UTC](https://forum.kirupa.com/t/advanced-accessing-a-classs-static-functions-from-a-variable-of-type-class/305137/1 "2010-02-19T16:40:20Z")

</div>

I realize this is kind of an odd issue, but I am wondering if there’s any way to get Flash to allow me to access a class’s static functions using a class variable that points to the class. Example:

I create a class called FooClass that has a static function named foo

I then create a variable of type Class that points to it

```auto
var class:Class = Class(getDefinitionByName("FooClass"));

```

However, when I try to call foo() using the variable, it errors saying the function doesn’t exist, even though the class has the function.

```auto
class.foo();

```

It is entirely possible that I have misunderstood what the Class variable type does in Flash, if that is the case, then I’ll rephrase.

I have an array of classes. That array stores an ID and name for each class as well as storing a Class variable that points back to the class. I want to be able to grab an arbitrary element from that array and call a static function based on the class of the element I selected.

Any thoughts are appreciated!
