i'm confused with the term "global" in AS3. within my main controller class, i've defined a variable (myNum) which i would like to access throughout all class .as files within the same package.
//Controller class
package myApp
{
public var myNum:int = 24; //try to access myNum in mySprite class
public class Main extends Sprite
{
}
}
______________________________
//Object class
package myApp
{
public class mySprite extends Sprite
{
trace (myNum);
}
}
the above code returns the following error:
5006: An ActionScript file can not have more than one externally visible definition
what is the proper way to set up a list of global variables that can be accessed throughout the entire scope of a package?