Parent

From Director Online Wiki
Jump to: navigation, search

In Object Oriented programming it is very common to have two objects having a parent-child relationship. The container object is the parent and the sub-object is the child. In Director this terminology can become confusing because of the special term "Parent Script".

Take this example:

   bolt = car.engine.parts[15]

In this case, "car" is the parent of engine, which is the parent of "parts". "parts" is the child of "engine" which is the child of "car". Note that engine is both a parent and a child, which is not uncommon.