MAX global variable in JAVA

kmll's icon

In MAX Javascript there is a functionality for storing global variables like this:

glob = new Global(“bounce”);

glob.starttime = 500;

Are there any similar arrangements for globals in JAVA?

Lee's icon

don't think so. quick scan of the mxj docs doesn't show anything obvious. the two languages are integrated at different levels with js being integrated in a tighter way than java (hence the ability to script etc through js) whereas java runs in a jvm and only has a bridge connecting them

nick rothwell | project cassiel's icon

Assuming your classes are being loaded by the same classloader, you can share statics:

Lee's icon

good point... I was thinking the OP wanted to also be able to access it from MAX, but I appear to have invented that bit...