Interfaces and methods overview – BrightSign Object Reference Manual (FW 5.1) User Manual
Page 10

2
INTERFACES AND METHODS OVERVIEW
Every BrightScript object consists of one or more "interfaces." An interface consists of one or more "methods." For
example, the roVideoPlayer object has several interfaces, including ifSetMessagePort. The interface ifSetMessagePort
has one method:
SetPort().
Example: The abstract interface ifSetMessagePort is exposed and implemented by both the roControlPort and the
roVideoPlayer objects. Once the
SetPort() method is called, these objects will send their events to the supplied
message port. This is discussed more in the
p = CreateObject("roMessagePort")
video = CreateObject("roVideoPlayer")
gpio = CreateObject("roControlPort", "BrightSign")
gpio.SetPort(p)
video.SetPort(p)
The above syntax makes use of a shortcut provided by the language: The interface name is optional, unless it is needed
to resolve name conflicts. For example, the following two lines of code carry out the exact same function:
gpio.SetPort(p)
gpio.ifSetMessagePort.SetPort(p)
BrightScript Objects consist only of interfaces, and interfaces define only methods. There is no concept of a "property" or
variable at the object or interface level. These must be implemented as “set” or “get” methods in an interface.