views:

27

answers:

1

I have a Flex application that can load modules as necessary. When the first module is loaded, it creates a class MyBackground(), which paints the background red. When I choose to load a second module (and unload the first) I again load a class MyBackground (from the second module). However, when I step into the constructor for MyBackground, it goes straight into the constructor for the UIComponentDescriptor:

public function UIComponentDescriptor(descriptorProperties:Object)
{
    super(descriptorProperties);
}

Is this something to do with using the same application domain for each module that I load? Does Flex load in the class types into the parent application and cache them, so when I request a class the second time it just does a lookup, without actually seeing if the class is the same?

Any info on this appreciated.

A: 

I've managed to fix the issue by using a child application domain (which doesn't make 100% sense as it says child domains can't override parent domains, yet that appears to be exactly what is happening).

m_moduleInfo.load(new ApplicationDomain(ApplicationDomain.currentDomain));
Mark Ingram