Porting _global in ActionScript from AS2 to AS3
Published by Nicholas Dunbar on February 2nd, 2011
Global variables
package {
// this reinstates the _global object that was removed from from AS3
// however one thing has changed the global object must have a
// category for storing data dynamically
// ex: _global.ply.name
// this is the name of the player stored in the global object
public class _global {
public static var ply:Object = new Object();
public static var gen:Object = new Object();
public static var glob:Object = new Object();
}
}
/*definitions here are automatically accessible to all code in the file where this is being declared. Aka. this is a security risk. Allowing a hacker to insert code into the global object at run time and then they can try and run it from anywhere in your program. */