Forum ActionScript 3.0 no static variables allowed

Problems and discussions relating to ActionScript 3.0 here.

no static variables allowed

Postby Mohsinre1 » November 12th, 2012, 12:23 am

How do I make a global variable that is accessible to all classes?
For example in my game I want to have a global variable that contains a list of all the entities that is accessible everywhere. How do I do that? I'm new to C# so I'm not sure if this is possible..
Mohsinre1
 
Posts: 2
Joined: November 11th, 2012, 9:39 am

Re: no static variables allowed

Postby dreamora » November 12th, 2012, 4:30 pm

You need to pass around that reference to this global container around manually.
As all stuff is maintained from the Game<T> instance, you can also make it control this 'shared datacontainer' object and maintain its existance.
dreamora
 
Posts: 225
Joined: March 2nd, 2012, 9:58 am

Re: no static variables allowed

Postby ASH1138 » January 16th, 2013, 11:26 am

Unfortunately, No static variables are allowed on the playerIO serverside code, which I think sucks! :cry:
ASH1138
 
Posts: 285
Joined: November 17th, 2012, 2:29 pm


Return to ActionScript 3.0