An application domain is the container to which a class definition belongs. The main application has a separate, top-level application domain called the system domain. A specific application is defined as a node in the system domain. When a flex sub-application is loaded into another main application, you can load this sub-application to one of the three application domain types, same-level domain (sibling domain), subdomain, and current domain. When you load a flex sub-application to a same-level application domain, the application domain of this Sub-application has the same parent application domain as its primary application domain, further, this sub-application is equivalent to other applications at the same level; when you load the sub-application to a sub-application domain, the application domain of this Sub-application is a sub-node of the main application domain. When you load a sub-application to the current domain, then the sub-application is loaded into the same application as the primary application domain. Each sub-application domain determines where the class is loaded.
By default, the swfloader and loader controls load a sub-application to a sub-application domain. If this sub-application and the main application are compiled by different versions of the Flex framework, a runtime error will occur. The cause of these errors is that the application sometimes translates different definitions for the same category.
You can set the loadforcompatibility attribute on swfloader to indicate the application domain to which the child application is loaded. If you set this attribute to true, the Child application is loaded with the same level application domain. If you set this attribute to false, the sub-application is loaded into the sub-application domain. The default value of this attribute is false. Therefore, sub-applications cannot be versionized by default.
You can specify the application domain on the loadercontext object. This is because you have specified the loadercontext attribute value when using the swfloader control. For details, see "specify loadercontext" on page 21 ".