Hi! I’m currently working on a game in which I have different modes, some of which I would like to be unlockable. I set up a few lines of code to cover two of the modes, ‘survival’ and ‘gate’. I *also *would like to be able to refer to these local variables throughout all scenes, so, after brushing up on _global variables in the tutorial on this site, I ended up with the following:
_global.local_data = SharedObject.getLocal(“user_data”);
_global.local_data.data.survival = false;
_global.local_data.data.gate = false;
Which all seems sound enough. I also have the code to retrieve my data:
stored_user_name = local_data.data.survival;
stored_user_age = local_data.data.gate;
So, before I plunge into this, I’d like a little more information…
[LIST]
[]Will I be able to refer to my ‘local_data’ variable with just _global. in front of it?
[]Will the following code work: if(_global.local_data == true) {
[*]Is there a better/more efficient way to do this?[/LIST]Thanks for your help!