Refer Object of Parent App using ParentApplication

Applications can load other applications; therefore, you can have a hierarchy of applications, similar to the hierarchy of documents within each application. Every UIComponent class has a parentApplication read-only property that references the Application object in which the object exists. The parentApplication property of an Application object is never itself; it is either the Application object into which it was loaded, or it is null (for the Application object).

Walking the application chain by using the parentApplication property is similar to walking the document chain by using the parentDocument property.

Ex:

parentApplication.viewstack1.selectedIndex=1

  this line of code is in a child component like titlewindow and viewstack1 is the reference of viewstack in App(parent)

2 Responses to “Refer Object of Parent App using ParentApplication”

  1. MarkaLot Says:

    I have a child component which is a swfloader and from this swfloader the parentApplication is always shows null not the real parent, please shed some lights over. very appreciate.

  2. kumargandhi Says:

    Hello there,
    rather than using swfloaders use the Moduleloaders [Module concept], they are very usefull and communication b/w modules is simple and small, read the concept at the Flex Help and try some examples This will defenetly solve your problem mentioned.

    regards,
    kumar.

Leave a Reply