instances by adding and accessing properties. You can also access Global object properties from Max messages completely outside of js. Executing methods stored in Global objects from Max is not supported. However, methods are certainly among the kinds of things you can store within a Global object.
g = new Global(name);
name represents a String that uniquely identifies the Global.
symbol with the name you supplied as an argument (this allows it to be accessed from Max). Every time you access a Global,
instances, and if they all have the same name, they will all share the same data. In this way, a Global resembles a namespace.
g = new Global("name");
g.bob = 12;
h = new Global("name");
post(h.bob); // will print 12
There are no fixed properties for a Global object. Instead, you assign properties to a Global object (described above)
so that they can be accessed by multiple js
sendnamed (receive_name, property_name)
Sends the value of the named property property_name to the named Max receive
object (or other Max object) bound to the specified receive_name symbol.
g = new Global("xyz");
g.ethyl = 1000;
objects named fred will send out their outlets.
To use Max to send a message to a named object, type a semicolon followed by the name of the receiver and the message you want to send into a message box. To set a property of a js
Global object, send the property name followed by one or more values (multiple values set the value of the property to an array). Assuming you have already created a Global xyz object...
This sets the value of the george property to 30.
; xyz george 30
This sets the value of the frank property to an array of three strings containing "x" "y" and "z"
; xyz frank x y z
You can also use the message sendnamed from Max to output property values to named receive
objects. This sends the current value of the frank property in the js
Global object xyz to any receive
objects named hubert.
; xyz sendnamed hubert frank
objects take action and output the property values.