Provides a location to store and access global variables. These variables are available to both Lingo and JavaScript syntax.
You can access the Global object by using the top level _global property. You can either assign _global to a variable, or use the _global property directly to access the Global objects methods and any defined global variables.
-- Lingo syntax objGlobal = _global // JavaScript syntax var objGlobal = _global;
-- Lingo syntax _global.showGlobals() // JavaScript syntax _global.showGlobals();
-- Lingo syntax
global gSuccess
on mouseDown
gSuccess = "Congratulations!"
put(gSuccess) -- displays "Congratulations!"
end
// JavaScript syntax
_global.gSuccess = "Congratulations!";
function mouseDown() {
trace(_global.gSuccess); // displays "Congratulations!"
}
|
Method |
|---|