Hierarchy of Objects in Opus

In Opus you can create many types of objects on a page, such as, Image, Text, Button and Frame objects, to name a few. In fact, everything in Opus is an object, including the page, a chapter and even the publication itself.

Therefore, Opus is an object-oriented program. For example, you can add chapters to a publication, pages to a chapter, objects to a page and then change the objects properties and make things happen by adding actions to the object.

When using OpusScript, it is useful to know about the hierarchy of objects in Opus because the OpusScript functions are split into separate folders, such as, Graphical Objects and Slideshow. These folders (or classes of objects to be more accurate) allow you to see which functions you can use with a specific type of object; for example, the Play function in the Slideshow category allows you to start a slideshow in your publication, it cannot be used to play a sound or start a timeline.

However, there are other OpusScript functions that you can use with Slideshow objects that are not listed in this category – but what are they? Well, it all depends on the category’s position in the hierarchy of objects, as explained below.

Hierarchy

  1. In the simplest terms, the hierarchy is shown in the Overview topic for each OpusScript Function folder under the heading Hierarchy – see Example.

  2. The Hierarchy heading shows the other OpusScript functions you can use for this type of object.

  3. The class structure heading shows a graphical representation of the class hierarchy – see Hierarchy of objects in Opus below for more information.

  4. The Functions heading in the Overview topic lists all of the OpusScript functions for this folder. Click on the name of the OpusScript function to jump to its help page.

Note:
The section below is an explanation of the hierarchy of objects as it relates to the OpusScript functions. You do NOT have to read this in order to use OpusScript, however, it may prove useful.

Hierarchy of Objects in Opus

  1. Objects belong to a class of objects. This simply means that objects of the same type belong to the same class, for example, all Text objects belong to the same text class and all MultiFrame objects belong to the same multiframe class.

  2. Classes are arranged in a hierarchy. This simply means that some classes belong to another class, which is known as the Parent. For example, the TextObjects class belong to the Parent known as Graphical Objects, therefore, the Text Objects class is a Child of the Graphical Objects class.

  3. Classes inherit the functions of their Parent. This simply means that the OpusScript functions listed in the parent folder can also be used by their children.

Note:
For example, the Text Objects folder contains the specific OpusScript functions that can ONLY be applied to Text objects, while its parent (the Graphical Objects class) contains OpusScript functions that can be used by Text objects but also by other children of Graphical Objects, such as Button objects and Slideshow objects.

  1. Classes inherit all functions higher up the hierarchy. In other words, if a Child has a Parent and it is itself the Child of another Parent, then the child can use the OpusScript functions of its parent and its parent’s parent.

Note:
For example, Text Objects can use all of the functions in the Graphical Objects folder and the Basic Objects folder because Graphical Objects is a Child of the Basic Objects class.

  1. The Basic Objects class is the Parent of all objects in a publication. The Basic Objects folder is the root of all objects in a publication – the OpusScript functions in this folder can be used by all objects that make up your publication.

  2. Some classes belong to the script only. Some folders, such as, Clock, Math and Numbers are the top of their hierarchy, i.e. they have no parent or children. In other words, the OpusScript functions contained in these folders can be used in a script but don’t actually refer to objects in a publication.

Note:
For example, the CreateClock function in the Clock folder allows you to create a clock in a script but it doesn’t manipulate a Clock object in your publication. This function will store the clock in a variable in the script, you can then display this variable in your publication to the user.

Related Topics:

Overview of Script Functions

The OpusScript Reference List