Director Help

Global

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 object’s methods and any defined global variables.

  • Assign _global to a variable.
    -- Lingo syntax
    objGlobal = _global
    
    // JavaScript syntax
    var objGlobal = _global;
    
    
  • Use the _global property directly.
    -- Lingo syntax
    _global.showGlobals()
    
    // JavaScript syntax
    _global.showGlobals();
    
    
  • Access a global variable.
    -- 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 summary for the Global object

Method 

clearGlobals()

showGlobals()

See also

_global