PureMVC Architects Lounge

Announcements and General Discussion => Fabrication => Topic started by: mico on July 21, 2010, 04:39:40



Title: FlexModuleLoader and application style
Post by: mico on July 21, 2010, 04:39:40
Hello Fabrication users!

There is a shell application here with a module that is loaded with FlexModuleLoader
Earlier (before I figured out that Fabrication is now supported again) this module was loaded using default <ModuleLoader> component and everything works good. The problem now is that application style is not used in the module loaded with FlexModuleLoader now. There is a number of assets including font styles and images and they are not appled now. The loader is now created in command and then it is added to a container:
:
private function onModuleReady(e:ModuleEvent):void
{
trace('LoadSearchModuleCommand:onModuleReady');
var scm : SectionContainerMediator = SectionContainerMediator(facade.retrieveMediator(SectionContainerMediator.NAME))
scm.mainDisplay.search.addElement(FlexModuleLoader(e.target));
}


Title: Re: FlexModuleLoader and application style
Post by: rafal.szemraj on July 21, 2010, 04:58:48
Hi,

Which version of fabrication and Flex SDK you are using?


Title: Re: FlexModuleLoader and application style
Post by: mico on July 21, 2010, 05:20:15
Flex SDK 4.1 and fabrication-0.7.3-flex.swc is used.
Also, Spark group is used as a container (scm.mainDisplay.search) for the FlexModuleLoader


Title: Re: FlexModuleLoader and application style
Post by: rafal.szemraj on July 21, 2010, 07:49:59
Hi,

Fabrication is compiled against Flex 4.0 so I don't know if this could be an issue, but I doubt it. Please, try 0.7.3.1. It has very important bug fix related to components and application domains. I'm not 100% sure, but this could be a reason why loaded module can't access style definitions from shell.


Title: Re: FlexModuleLoader and application style
Post by: mico on July 21, 2010, 08:06:39
Thanks for the fast reply Rafal. Updating to 0.7.3.1 doesn't help and I can't check the Flex 4.0 version because this app doesn't work well with this sdk.


Title: Re: FlexModuleLoader and application style
Post by: rafal.szemraj on July 21, 2010, 12:29:26
Ok, is there any chance you to provide me with a little example of the issue?


Title: Re: FlexModuleLoader and application style
Post by: mico on July 22, 2010, 12:58:53
Here is a small demo: www.slide.name/styledmodule.fxp (http://www.slide.name/styledmodule.fxp)


Title: Re: FlexModuleLoader and application style
Post by: rafal.szemraj on July 22, 2010, 12:10:45
Don't know why, but it seems to work this way http://www.flexthinker.com/2010/03/flex4-moduleloader-and-runtime-skins/. You have to remember to add ModuleLoader ( FlexModuleLoader ) to display list BEFORE you start loading module.

This is bad situation because in this case new FabricationModuleLoader and FabricationAirModuleLoader classes ( based on ModuleManager ) won't work properly.