Lets say I have menu.lua containing:
myName = "Tom’;
I then use Director to go to screen 1 and want:
print(myName);
This will show nil. I can however use:
_G.myName = “Tom”;
to set the variable in menu.
But why doesn’t the first example work. I thought everything not local in lua went into _G?
In short, if I set: myName = "Tom’; on a file, why isn’t it accessible forever by all other pages?
Thanks
Tom [import]uid: 55068 topic_id: 13662 reply_id: 313662[/import]
