Accessibility: Enlarging text in Flex
By Gerben Robijn on Oct 15, 2007 in Actionscript 3, CSS, Flex, Tutorial
I'm currently busy for a project at theFactor.e which needs the fontsize to be set a couple of point bigger and back again to increase accessibility of the webapplication. This is what I ended up with and this is how it is done:
It all works with 3 stylesheets. In my example default, normal and enlarged. The default works like a normal stylesheet and is added like this to your application:
-
<mx:Style source="assets/css/default.css"/>
The other two are compiled to swf when building the application. How do you achieve this you probably wonder. Well you just do a right mouse click on the css file and then select "compile CSS to SWF" like this:

Then you add this peace of code to load the compiled css as a style on runtime:
-
StyleManager.loadStyleDeclarations("assets/css/enlarged.swf");
And that's really it. Look in the source for more details.






