CodeQrius
CodeQrius

Reputation: 429

Exposing static properties in your Flex class

I have an actionscript class in my flex app that looks like this:

package Assets
{    
    public class AppIcons {

        public function AppIcons() {

        }

        [Bindable]
        [Embed(source="assets/ico_16.png")]
        public static var Icon_16:Class;

        [Bindable]
        [Embed(source="assets/ico_32.png")]
        public static var Icon_32:Class;    

    }

}

I want to know if I can extend this class and create another class that lets me access the properties as instances of that new class. Since these are static, I cannot access these as instances.

Upvotes: 0

Views: 559

Answers (1)

tefozi
tefozi

Reputation: 5480

You don't need an instance to call static variables. You can access them through the class.

Pattern for static method/variable: ClassName.StaticVariableName

So just call:

var icon:Class = AppIcons.Icon_16

Upvotes: 1

Related Questions