简体   繁体   中英

Flex 4: parent and owner property of UIComponent

I'm trying to understand the difference between the owner and parent properties of the UIComponent.

<s:Panel id="panOne" title="Success">
     <s:Label id="labOne" text="Hello World!!"/>
</s:Panel>

In the above code, labOne.owner.id returns panOne and labOne.parent.id returns contentGroup .

I understand the owner property refers to the parent container of a component (Label in this case). But what does parent property actually mean? I think it relates to some skin concept which has a with id value of contentGroup.

Could someone give exact difference between these two?

Thanks Jason. There is another link in the link provided by you. It explained these two terms very clearly. That link is: Gumbo DOM Tree API - Functional and Design Specification

I have pasted below the best lines from that page.

The parent of a visual element is the container directly in charge of laying it out. The owner of a visual element is the component that logically owns it. If a Button is in a SkinnableContainer, its parent is the contentGroup while its owner is the SkinnableContainer.

Flexponential has a pretty article explaining the differences between parent and owner.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM