Flex Parentapplication parentdocument Parent Dispatchevent

Source: Internet
Author: User

1, Parentapplication
The Parentapplication property of the component contains the Application object of this component, and the parentapplication of the Application object itself is null. When a flex program generates a SWF file that is loaded by another flex program, the Parentapplication property of the component in the loaded Flex program remains the same, in which case the Parentapplication property may represent the main program
The build also has two related properties: the Parent property, which refers to an object containing the component's parents, and the Parentdocument property, which is the object at the top of the hierarchy in the application program or user group where the component resides. The Parentdocument and parent properties are easily confused and sometimes point to the same object. For example, in customizing a component that inherits the canvas, called Cartcell, which puts a checkbox with an ID of Cart_check, then this Cart_ The Parent property and the Parentdocument property of a check always represent the Cartcall component itself. If you create a canvas named Check_holder in Cartcell, place the cart_check inside Check_holder so that the two-level container is formed in Cartcell. At this point, the parent of Cart_check points to Check_holder, and Parentdocument still points to the Cartcell component unchanged.
2. About Dispatchevent He is a core method of the Flex event mechanism for distributing events: This.parentApplication.dispatchevent (New Cartevent (Data,cart_   check.selected)); The purpose of this code is to this.parentapplication objects (that is, application itself) and distribute the newly created Cartevent objects. The new Cartevent object also contains two properties that hold the necessary information. This information is available when an object listens to this event
3, Skilled super () of the use of the environment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.