Namespaces identify a “node” of properties and methods. When you create a new
script for an object (“New” button in the General Properties page), you are
actually creating an accessible “root” namespace for that object.
Sub-spaces group common functionality for the object. For instance:
| Object.Left |
Let you access (read/write) the Left property from the Object
namespace |
| Object.State(“Mouse over”).Picture |
Let you read/write the Picture property for the State(“Mouse over”)
namespace, that is accessed from the Object namespace |
| Object.Parent |
Let you access the root script namespace of the parent object. From
here on, you can do as above: Object.Parent.Object.Left,
Object.Parent.Object.State(“Mouse over”).Picture
Important: It assumes the parent object actually has a script namespace,
i.e. it has a script associated. If this isn’t the case, you’ll get a
script error when trying to access the parent members. |
| DesktopX.ScriptObject(“object01”) |
Let you access the root namespace for object01. This means you can
access all sub namespaces like Object and Control, global variables and
functions. |
|
DesktopX.ScriptObject(“object01”).Object.Name |
Name property for the “object01” object. |
| DesktopX.ScriptObject(“object01”).myvariable1 |
Read/write myvariable1 declared in the “object01” script. |
| DesktopX.ScriptObject(“object01”).myfunc1 args |
Call myfunc1 declared in the “object01” script. |
| DesktopX.Object(“object01”) |
Gives straight access to the plain Object namespace. This is usually
a shortcut and memory saving technique, because it let you access the
Object namespace without that “object01” actually has a namespace
associated. |