views:

43

answers:

0

Hi,

I am developing a modular Flex 4 (or more precisely AIR1.5, if that makes difference) application and encountered rather ugly problem.

In the main App I have a style.css, which defines all the styles for, let's say, spark Buttons. It looks more or less like this:

s|Button, .moduleButton{
  font-family: "Fonter";
  skin-class: ClassReference("skins.MyButtonSkin");
}

It works perfectly fine on all spark buttons in the main app, but I am loading a module (using ModuleLoader) which also uses spark buttons, and I'd like it to use the above styling.

Unfortunately it doesn't. I can manually do something like this:

myButton.setStyle("fontFamily", "Fonter");
myButton.setStyle("skinClass", getDefinitionByName("skins.MyButtonSkin");

But it is an ugly workaround which requires loads and lots of changes in case I want to make changes to the button class. Obviously, using moduleButton as styleName didn't work either.

Anyone got any insight on how to force the modules to use styling from the parent application?


Ok, I have found that adding the -isolate-styles=false to the compiler parameters makes it work right... Well, except the little fact, that now I can't override the styles in any way, or at least I can't find a way to do.