-
1. Re: set stylesheet in actionscript
Wrataxas Jan 10, 2011 1:47 AM (in response to hidarikani)yourObject.setStyle( "fontSize", textHeight );
Works for all styles that yourObject supports.
-
2. Re: set stylesheet in actionscript
hidarikani Jan 10, 2011 11:17 PM (in response to Wrataxas)But what about applying a .css file not a single style property?
-
3. Re: set stylesheet in actionscript
hidarikani Jan 19, 2011 1:04 AM (in response to hidarikani)Bump.
-
-
5. Re: set stylesheet in actionscript
Gaurav J Jan 19, 2011 8:38 AM (in response to _spoboyle)See http://gauravj.com/blog/2010/02/stylish-modules-and-sub-applications/ - In the example the module is loading css compiled to a swf.
-Gaurav
-
6. Re: set stylesheet in actionscript
Gregory Lafrance Jan 19, 2011 9:19 AM (in response to hidarikani)import mx.styles.StyleManager;
private function init():void{
myDynStyle = new CSSStyleDeclaration('myDynStyle');
myDynStyle.setStyle('color', 'blue');
myDynStyle.setStyle('fontFamily', 'georgia');
myDynStyle.setStyle('themeColor', 'green');
myDynStyle.setStyle('fontSize', 24);StyleManager.setStyleDeclaration("Button", myDynStyle, true);
}
If this post answers your question or helps, please mark it as such. Thanks!
http://www.stardustsystems.com
http://www.stardustsystems.com/blog
Adobe Flex Development and Support Services -
7. Re: set stylesheet in actionscript
hidarikani Jan 20, 2011 12:00 AM (in response to Gaurav J)In the example the module is loading css compiled to a swf.
I'm actually trying to style modules. I thought all modules should use one css file to ensure a consistent look but after reading the documentation it seems that a global css will load unused class definitions to the module's application domain because it contains styles for all modules.
By the way, is using the <fx:Style/> tag inside of a module not recommended?
-
8. Re: set stylesheet in actionscript
hidarikani Jan 23, 2011 11:39 PM (in response to hidarikani)Solved the problem by removing all <fx:Style/> tags and adding the css file as a theme instead.
Adding the file as a theme made the styles available in the main app and the modules so there's no need for loading them at runtime.



