Despite if it is good practice or not, I read here that you can have package variables (or constants), so I tried this:
// globals.as
package global
{
public const someConst:String = 'theValueOfTheConst';
public var someVar:String = 'theValueOfTheVar';
}
// SomeClass.as
package pack.to.the.class
{
// ...
import global.*;
// ...
// ...
public function aFunction():void
{
trace(someConst);
trace(someVar);
}
// ...
}
And all I have is an Compile-time Error that says "Definition of global:someConst has not been found" (the same for someVar)
I'm using Flex and I see this in Problems. So, is this possible? Can I have package variables (or constants) without using a Class?
Thanks!
PS: The package names, the variables names and function names are all an example, I use other names when I tested.