Function to retrieve the Element object of a child in the specified Element object. For example, Available in: Controller, Processor. Returns the Element object of the found child. Returns Description
this.parent
specifies the parent layer of the script module as the Element object to be searched in. This function does not search in subelements. A particular child can be searched by name or position. The position is the number indexing the children in the specified Element object. If several children share the same name, only the first match will be returned. If no argument is set, the function returns the first child it finds.Arguments
nameOrPosition The name or position of the child. Set this to nil
to deactivate the search filter.string or number, optional Return Values
nil
if no child is found.Example
-- locate the first child in the program and print its name
child = this.program:getChild()
if child then
print(child.name)
else
print("Could not find a child!")
end
getChild(nameOrPosition)
Overview
Content Tools
1 Comment
Sabine Pfeifer
proofread done