Apr 28 2010
Using new StyleManager in Flex 4
With Flex 4 the StyleManager is no longer a Singleton class. Its implementation has changed so that every loaded module has its own instance of StyleManager.
This post by Gaurav Jain explains how you can use it so that the loaded modules have their own separate style manager.
But it doesn’t say how you can access the toplevel or default StyleManager.
The old, Flex 3, way of accessing it would be,
var tempStyle:CSSStyleDeclaration = StyleManager.getStyleDeclaration(“.tempStyle”);
the above method is deprecated and will give you a warning.
The correct way now of using the StyleManager would be the following,
var tempStyle:CSSStyleDeclaration = StyleManager.getStyleManager(null).getStyleDeclaration(“.tempStyle”);
StyleManager.getStyleManager(null);, returns the top level instance of StyleManager.
Thanks.
Or FlexGlobals.topLevelApplication.styleManager.getStyleDeclaration(“someStyle”);
Sure i don’t mind it.
And what’s more unimaginable is that you don’t must be a tech savvy to
use this hack.
gratis v bucks generator
Blog for Nayan » Using new StyleManager in Flex 4