Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Finding the group a display object belongs to
Started by richard11 Jan 13 2019 05:10 AM

2 replies to this topic

Best Answer ldurniat , 13 January 2019 - 06:04 AM

Hi Richard,

 

Try use object.parent  This can be useful for you I think. 

 

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

 

Have a nice day:)

 

ldurniat

[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

richard11

[GLOBAL: userInfoPane.html]
richard11
  • Contributor

  • 448 posts
  • Corona SDK

Wondering if Corona offers a way of iterating through the hierarchy of display objects, like with jQuery for example?

 

I.e. say you have a tap event on an object:

myEvent = function(event)

end

myObject:addEventListener( "tap", myEvent )

Within the tap event you can access the tapped onject with event.target, but can you determine its display group/container, and the other sibling objects of that group?



[TOPIC: post.html]
#2

ldurniat

[GLOBAL: userInfoPane.html]
ldurniat
  • Contributor

  • 389 posts
  • Corona SDK

  Best Answer

Hi Richard,

 

Try use object.parent  This can be useful for you I think. 

 

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

 

Have a nice day:)

 

ldurniat



[TOPIC: post.html]
#3

richard11

[GLOBAL: userInfoPane.html]
richard11
  • Contributor

  • 448 posts
  • Corona SDK

Ah, perfect!

 

As it happens I've gone about this a slightly different way now anyway, but that's exactly what I was looking for, yes.




[topic_controls]
[/topic_controls]