ACComponents are started using the StartACComponent() method. The first parameter is the class name of the ACComponent.
At startup:
- the constructor is called first,
- The ACInit method is called and the new instance is added as a child object to the currently calling ACComponent,
- the ACPostInit method is called.
After these steps, you can work with the instance. If an instance is no longer needed, you can terminate it using the Stop() method:
In the above example, an additional check is added:
If you place a question mark "?" before the class name when calling the ACUrlCommand() method, the system first checks whether an instance already exists as a child object.
More about the life cycle of an ACComponent and the command ACUrlCommand can be read in the following subsection.