object.parent

Type GroupObject
Object DisplayObject
Library display.*
Revision 2017.3111
Keywords group, parent group
See also display.newGroup()

Overview

A read-only property that returns the object's parent.

Example

local group = display.newGroup()
 
local rect = display.newRect( 100, 100, 50, 50 )
rect:setFillColor( 0.7 )
group:insert( rect )
 
rect.parent:remove( rect )  --removes rect from group