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
![]()
SPONSORED LINKS
Web site design development Computer software development Software design and development Macromedia flex Software development best practice
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
__,_._,___
Reply via email to
This topic is covered in the upcoming book on Flex via "self-initializing" modules. Please contact me offline as the process is well defined but not automated yet - so it takes about 4 pages to describe it in reasonable way.
Regards,
Anatole
On 8/9/06, astgtciv <[EMAIL PROTECTED]> wrote:

