views:

505

answers:

3

Can a flex module have styles different from the main application which loads the modules? Meaning... can I have a main set of styles for the application, and separate styles for each module.. with each of them rendering their own styles without disturbing the other at runtime?

My specific case: The main application is developed by me... and the modules are developed by different people who want to contribute to the main application. I want to provide some way for each of the module developers to have their own styles for their modules, without touching the main application or its styles.

A: 

I don't belive you can do what you're asking (although I'd like to know if I'm wrong), as in say have two css files one for a module and one for the main app. What you could do is inside the css sheet instead of declaring a single Canvas style do something like

Canvas.mainapp { ... }

Canvas.module { ... }

Then inside your module when you declare a Canvas set its style to 'module' and inside the main apps whenever you declare a Canvas set its style to 'mainapp'

That would do.

kenneth
Thanks for the response kenneth. In my case, the main application is developed by me... and the modules are developed by different people who want to contribute to the main application. I want to provide some way for each of the module developers to have their own styles for their modules without touching the main application or its styles. Getting a little tricky now? :)
Anand
That CSS syntax is not supported in flex 3 unfortunately.
Hrundik
A: 

Try loading your modules into separate application domain (which is not a child of the application domain of your main application).

Hrundik
A: 

hi guys, i want to show one module as two time in hbox container, with different style,we are loading the style at runtime, but style manager is single ton, so it override the old style definition,

So now we using another methode,we loop the displayObject and apply the style to corresponding dispalyObject,

using setStyle method, But in past i read some thing like dnot use setStyle method it affect the performance in flex,

Any other idea friend,

syeddiwan