{"id":401,"date":"2010-04-28T14:32:21","date_gmt":"2010-04-28T21:32:21","guid":{"rendered":"http:\/\/www.nayansavla.com\/blog\/?p=401"},"modified":"2010-04-28T14:32:21","modified_gmt":"2010-04-28T21:32:21","slug":"using-new-stylemanager-in-flex-4","status":"publish","type":"post","link":"https:\/\/www.nayansavla.com\/blog\/?p=401","title":{"rendered":"Using new StyleManager in Flex 4"},"content":{"rendered":"<p>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.<br \/>\n<br \/>\nThis <a href=\"http:\/\/gauravj.com\/blog\/2010\/02\/stylemanager-in-flex-4\/\" target=\"_blank\">post<\/a> by Gaurav Jain explains how you can use it so that the loaded modules have their own separate style manager.<br \/>\n<br \/>\nBut it doesn&#8217;t say how you can access the toplevel or default StyleManager.<\/p>\n<p>The old, Flex 3, way of accessing it would be,<\/p>\n<p>var tempStyle:CSSStyleDeclaration = StyleManager.getStyleDeclaration(&#8220;.tempStyle&#8221;);<br \/>\n<br \/>\nthe above method is deprecated and will give you a warning.<br \/>\n<br \/>\nThe correct way now of using the StyleManager would be the following,<\/p>\n<p>var tempStyle:CSSStyleDeclaration = StyleManager.getStyleManager(null).getStyleDeclaration(&#8220;.tempStyle&#8221;);<br \/>\n<br \/>\nStyleManager.getStyleManager(null);, returns the top level instance of StyleManager.<br \/>\n<br \/>\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&#8217;t say how you can [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-401","post","type-post","status-publish","format-standard","hentry","category-flex"],"_links":{"self":[{"href":"https:\/\/www.nayansavla.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/401","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nayansavla.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nayansavla.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nayansavla.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nayansavla.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=401"}],"version-history":[{"count":0,"href":"https:\/\/www.nayansavla.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/401\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.nayansavla.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=401"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nayansavla.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=401"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nayansavla.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=401"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}