# Accessing static variables of a super class through a subclass

**URL:** <https://forum.kirupa.com/t/accessing-static-variables-of-a-super-class-through-a-subclass/324255>\
**Category:** Uncategorized\
**Created:** [August 10, 2011, 7:49pm UTC](https://forum.kirupa.com/t/accessing-static-variables-of-a-super-class-through-a-subclass/324255 "2011-08-10T19:49:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lobsterhat](https://avatars.discourse-cdn.com/v4/letter/l/278dde/32.png) [@lobsterhat](https://forum.kirupa.com/u/lobsterhat)\
**Post date:** [August 10, 2011, 7:49pm UTC](https://forum.kirupa.com/t/accessing-static-variables-of-a-super-class-through-a-subclass/324255/1 "2011-08-10T19:49:23Z")

</div>

I’m trying access a static variable located of a super class through an instance of one of it’s subclasses and I’m receiving an access of undefined property error (example of which below).&nbsp; Creating another static variable in the subclass and assigning the value from the super class will allow me to dot operate to it.&nbsp; I was wondering if anyone knew of a better way to do this, thanks.

Doc Class

```php

public class TestingDocClass extends Sprite 
    {
        public function TestingDocClass()
        {
            //trace(Fruit.COLOR); //returns red
            
            // This returns 1119: Access of undefined property error
            trace(Apple.COLOR);
        }
    }

```

Sub-class

```php

public class Apple extends Fruit 
    {
        public static const IS_DELICIOUS:Boolean = true;
        //public static const APPLE_COLOR:String = Fruit.COLOR;
    }

```

Super-class

```php

public class Fruit
    {
        public static const COLOR:String = "red";
    }

```
