I'm doing some runtime skinning in an ActionScript 3 only project, no Flex SDK. I'm having problems getting the ApplicationDomain to work the way I want because ApplicationDomain is read-only.
If I load an external skin SWF with ApplicationDomain set to the current domain, my child classes aren't overridig the parent skin classes. I've read Roger Gonzalez' blog entry about AppDom rules, so I know why a child SWF cannot replace classes in the SWF that loaded it. However, if I create a unique AppDom, the base class, in this case AbstractSkin, is a different class than the parent SWF's AbstractSkin because they come from 2 different AppDom's. Thus, casting fails because I'm casting to the AbstractSkin in the parent SWF, not the child SWF... even though they are both technically the same class. Since I'm using Flash CS3 to compile the skins, I cannot use mxmlc to load-externs, and thus compile the skin SWF without AbstractSkin actually compiled into the skin SWF. The only thing I can think to do is have all child SWF's have a different package path for their skins, say, com.loadedskin.SomeSkin, and then all default skins have com.internalskin.SomeSkin. That way, when I load a child SWF into the parentDomain, it won't be a problem because they aren't replacing any classes since they are new. ...any ideas? I could really go for a ApplicationDomain.setDefinitionmethod...

