panthro
panthro

Reputation: 24099

AS3 variable, access throughout app?

In AS3, is there a way to declare a variable in my base class and be able to access it in all other classes in the program?

Thanks for your help.

Upvotes: 0

Views: 92

Answers (1)

Sam DeHaan
Sam DeHaan

Reputation: 10325

In order to use 'global' variables in AS3, you declare them static

public static var myGlobal:Object;

Whatever class that is declared in, you can then on access it by

ClassName.myglobal

Upvotes: 1

Related Questions