parentApplication and FlexGlobals.topLevelApplication in Flex 4
Asked Answered
M

1

7

In Flex 4, are there any differences between parentApplication and FlexGlobals.topLevelApplication? Are referring to the same top level application?

I think both are same; one (parentApplication) belongs to Spark and the other (FlexGlobals.topLevelApplication) belongs to Halo. Is my understanding correct?

Microseism answered 25/5, 2011 at 6:21 Comment(0)
L
8

Check out this Adobe livedoc, it clearly states:

  • mx.core.FlexGlobals.topLevelApplication: The top-level application object, regardless of where in the document tree your object executes. This object is of type spark.components.Application or mx.core.Application.

  • mx.core.UIComponent.parentDocument: The parent document of the current document. You can use parentDocument.parentDocument to walk up the tree of multiple documents.

  • mx.core.UIComponent.parentApplication: The Application object in which the current object exists. Applications can load other applications, therefore, you can access the immediate parent application by using this property. You can use parentApplication.parentApplication to walk up the tree of multiple applications.

Cheers

Leacock answered 25/5, 2011 at 7:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.