When creating an MXML application (with Application as the top tag), the Style classes for all the components referenced in the Application (e.g., a Panel) are included in the resulting swf, and the styles are initialized. What I am trying to do, however, is to dynamically load a custom UIComponent. I have tried both 1) creating an MXML app with the CustomUIComponent as the top tag and dynamically loading it, and 2) creating a Flex Library project, exporting it to a directory and subsequenty using a factory pattern to instantiate an instance of my custom UIComponent.
Both of these approaches suffer from the following, though: if my CustomUIComponent includes a Panel (not referenced in the top-level application), the Panel Style does not get included into the module being dynamically loaded, which causes its code to crash in Panel.layoutChrome as it cannot find its style. It seems that when compiling an Application, the compiler checks which components are used and includes/initializes the appropriate styles. How to force this behaviour without the Application being there? Do the "mixins" have something to do with this? Or do I have to explicitly define my own styles for all the components loaded that way? (I can of course, explicitly include (an "artificial") reference to Panel in the top-level Application, but that defeats the whole point of dynamic module loading. Note that Roger Gonzalez's great example "Modular Applications" on his blog: http://blogs.adobe.com/rgonzalez/2006/06/modular_applications_part_2.html#more suffers from exactly the same problem (and the UIComponent example [app/mymodule] crashes at runtime the same way). Which is probably not good news for me... :) -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

