I am designing a flash website and I made it object oriented. I have a lot of classes and I am having difficulty in accessing information ( variables ) from other classes.
To do so I usually include the variable at the parameters of my class’ functions ( or constructor) OR I create custom event objects that will transport the variables to another class ( that listens for them ). This methods are sluggish.
I know there are local variables ( those who are declared inside a function and are available only to that function ) and global variables ( who are declared inside a class as private or public and are available in that class ). Can I, somehow, create some sort of ‘superglobal’ variables that are available to the whole flash program?
If not, do you guys know a way to pass along variables in an OOP design?
Thanks! I will try to implement a singleton.
Singleton class:
I think I get it now. Thanks!