Class operations can be static or non-static (see Adding Operation Calls). If an operation is non-static, it can only be executed on a given instance of the related class: You need to provide an object of this class to the target pin of the operation.
Within this operation, the contents of the object are available via the self context.
Example
Assume you have the following Product class with
-
a non-static updateStock operation that updates a given quantity of the current product to the stock
-
and a static updateStorageSystem operation that updates the storage system with a given quantity
The self context provides the object content via the keyword self to the operation updateStock().
|
Target |
Syntax |
Description |
Example |
|---|---|---|---|
|
Property |
|
Use this notation to access to a property of the related class. |
|
|
Operation (non-static) |
|
Use the dot notation to call to a non-static operation of the related class. |
|
|
Operation (static) |
|
Use the usage notation (colon) to call a static operation of the related class. |
|
Within Action Script, you can also invoke operations:
-
built-in Action Script operations, like e.g. log() or createUUID()
set key = createUUID(); -
operations that apply to a dedicated type, like concat() or convertToString()
concat("Dear ", name) -
class operations that have been defined by the developer on custom classes
article.getBOM(...
Built-in Action Script operations can be invoked directly from within Action Script. However, to invoke a type or class operation, you always need an object of that type or class to invoke the operation on (see also Object Navigation on Basics of the Action Script Language). This is necessary for the Compiler to find the operation.
Related Content
Related Pages:
-
Creating Objects of Base and Complex Types
How to create objects of simple and complex type.