These docs are *very* out of date.
You will be redirected to the new docs in a few seconds.
If you are certain you want to see the old docs, click cancel.
Cancel | Continue to new docs
You will be redirected to the new docs in a few seconds.
If you are certain you want to see the old docs, click cancel.
Cancel | Continue to new docs
object.parent
Description:
A read-only property that returns the object's parent.
Syntax:
Example:
local group = display.newGroup() local rect = display.newRect(100, 100, 50, 50) rect:setFillColor(170, 170, 170) group:insert(rect) rect.parent:remove(rect) --removes rect from group
Returns:
Remarks:
Supported on operating systems and platforms for build numbers shown:
- Mac OS X:Corona SDK 1.0
- Windows:Corona SDK 2.0
- iOS:Corona SDK 1.0
- Android:Corona SDK 2.0
Replies
Posted on Sun, 2012-02-05 20:00
#2
This example does remove rect from the group, named "group".
The stage is also a group (the main one), which contains the group named "group".
Posted on Sun, 2012-02-05 21:12
#3
oh yeah, I mis-read it....I was thinking it was removeSelf() on the parent (ie group) and thus was removing the whole hierarchy...rather than just the rect.
Sorry for the false alarm...
unless I'm mistaken, this comment is wrong:
--removes rect from group
it should remove the whole "group" from the stage