<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Loading cascading style sheets on the fly using the Flex StyleManager class</title>
	<atom:link href="http://blog.flexexamples.com/2007/12/12/loading-cascading-style-sheets-on-the-fly-using-the-flex-stylemanager-class/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com/2007/12/12/loading-cascading-style-sheets-on-the-fly-using-the-flex-stylemanager-class/</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Sun, 12 Feb 2012 19:26:49 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Judah</title>
		<link>http://blog.flexexamples.com/2007/12/12/loading-cascading-style-sheets-on-the-fly-using-the-flex-stylemanager-class/comment-page-1/#comment-9027</link>
		<dc:creator>Judah</dc:creator>
		<pubDate>Tue, 08 Mar 2011 08:59:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/12/12/loading-cascading-style-sheets-on-the-fly-using-the-flex-stylemanager-class/#comment-9027</guid>
		<description>Is it possible to load in a CSS file (not .swf) at runtime and get the same behavior? Using Flex Hero.</description>
		<content:encoded><![CDATA[<p>Is it possible to load in a CSS file (not .swf) at runtime and get the same behavior? Using Flex Hero.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anubhav Soni</title>
		<link>http://blog.flexexamples.com/2007/12/12/loading-cascading-style-sheets-on-the-fly-using-the-flex-stylemanager-class/comment-page-1/#comment-6628</link>
		<dc:creator>Anubhav Soni</dc:creator>
		<pubDate>Fri, 18 Dec 2009 13:52:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/12/12/loading-cascading-style-sheets-on-the-fly-using-the-flex-stylemanager-class/#comment-6628</guid>
		<description>Thats a kool example,

thanks alot</description>
		<content:encoded><![CDATA[<p>Thats a kool example,</p>
<p>thanks alot</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Maverick</title>
		<link>http://blog.flexexamples.com/2007/12/12/loading-cascading-style-sheets-on-the-fly-using-the-flex-stylemanager-class/comment-page-1/#comment-6197</link>
		<dc:creator>Maverick</dc:creator>
		<pubDate>Mon, 02 Nov 2009 15:44:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/12/12/loading-cascading-style-sheets-on-the-fly-using-the-flex-stylemanager-class/#comment-6197</guid>
		<description>I was receiving the error: Unable to load style(Error #2036: Load Never Completed.

The CSS that I wanted to use is named SimplicityGray.swf

in my application I set my style this way:
StyleManager.loadStyleDeclarations(&#039;simplicitygray.swf&#039;,true);

I was struggling to determine why the CSS couldn&#039;t be found. Then I realized the name is case-sensitive. 
I solved the problem by using:
StyleManager.loadStyleDeclarations(&#039;SimplicityGray.swf&#039;,true);</description>
		<content:encoded><![CDATA[<p>I was receiving the error: Unable to load style(Error #2036: Load Never Completed.</p>
<p>The CSS that I wanted to use is named SimplicityGray.swf</p>
<p>in my application I set my style this way:<br />
StyleManager.loadStyleDeclarations(&#8216;simplicitygray.swf&#8217;,true);</p>
<p>I was struggling to determine why the CSS couldn&#8217;t be found. Then I realized the name is case-sensitive.<br />
I solved the problem by using:<br />
StyleManager.loadStyleDeclarations(&#8216;SimplicityGray.swf&#8217;,true);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthew de Verteuil</title>
		<link>http://blog.flexexamples.com/2007/12/12/loading-cascading-style-sheets-on-the-fly-using-the-flex-stylemanager-class/comment-page-1/#comment-2111</link>
		<dc:creator>Matthew de Verteuil</dc:creator>
		<pubDate>Fri, 24 Apr 2009 17:27:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/12/12/loading-cascading-style-sheets-on-the-fly-using-the-flex-stylemanager-class/#comment-2111</guid>
		<description>Trevor,

I was having the same issue as you, and in lieu of having to redo things with several Text in a mass hack effort I refused to give up on solving it.

All that aside, the solution to our problem was actually hidden what Mark said above.

It&#039;s the creationPolicy and order of operations. My current set up is:

1. Initialize Preloader
2. Clear everything
3. Create Preloader Assets
4. Start loading (Progress events begin dispatching)
5. Complete event is heard
6. Load Styles (Style progress events begin dispatching)
7. Styles loaded event is heard
8. Invoke Application.application.createComponentsFromDescriptors() (initProgress dispatching now)
9. Init complete
...
11. Preloader dispatches complete event
12. Application displays (correctly now)

Hopefully, you are in a position where you can easily rearrange the order that the preloader is doing things.

Best,
Matthew</description>
		<content:encoded><![CDATA[<p>Trevor,</p>
<p>I was having the same issue as you, and in lieu of having to redo things with several Text in a mass hack effort I refused to give up on solving it.</p>
<p>All that aside, the solution to our problem was actually hidden what Mark said above.</p>
<p>It&#8217;s the creationPolicy and order of operations. My current set up is:</p>
<p>1. Initialize Preloader<br />
2. Clear everything<br />
3. Create Preloader Assets<br />
4. Start loading (Progress events begin dispatching)<br />
5. Complete event is heard<br />
6. Load Styles (Style progress events begin dispatching)<br />
7. Styles loaded event is heard<br />
8. Invoke Application.application.createComponentsFromDescriptors() (initProgress dispatching now)<br />
9. Init complete<br />
&#8230;<br />
11. Preloader dispatches complete event<br />
12. Application displays (correctly now)</p>
<p>Hopefully, you are in a position where you can easily rearrange the order that the preloader is doing things.</p>
<p>Best,<br />
Matthew</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://blog.flexexamples.com/2007/12/12/loading-cascading-style-sheets-on-the-fly-using-the-flex-stylemanager-class/comment-page-1/#comment-2110</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Mon, 13 Apr 2009 22:27:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/12/12/loading-cascading-style-sheets-on-the-fly-using-the-flex-stylemanager-class/#comment-2110</guid>
		<description>Have you had any problems with wrapping in text controls (mx.controls.Text) when loading css at runtime?  Using this method it reduces all my text controls&#039; content to one line whether they have explicit htmltext line breaks or they have a fixed width to force them to wrap on their own.  I haven&#039;t been able to find a solid work around ANYwhere.  It&#039;s drivin me crazy.  Some insight would be greatly appreciated.

Thanks,
Trevor</description>
		<content:encoded><![CDATA[<p>Have you had any problems with wrapping in text controls (mx.controls.Text) when loading css at runtime?  Using this method it reduces all my text controls&#8217; content to one line whether they have explicit htmltext line breaks or they have a fixed width to force them to wrap on their own.  I haven&#8217;t been able to find a solid work around ANYwhere.  It&#8217;s drivin me crazy.  Some insight would be greatly appreciated.</p>
<p>Thanks,<br />
Trevor</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fly-in</title>
		<link>http://blog.flexexamples.com/2007/12/12/loading-cascading-style-sheets-on-the-fly-using-the-flex-stylemanager-class/comment-page-1/#comment-2114</link>
		<dc:creator>fly-in</dc:creator>
		<pubDate>Mon, 02 Mar 2009 17:26:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/12/12/loading-cascading-style-sheets-on-the-fly-using-the-flex-stylemanager-class/#comment-2114</guid>
		<description>Cool I have been wondering how to get rif of that flicker.

Thanks guys!</description>
		<content:encoded><![CDATA[<p>Cool I have been wondering how to get rif of that flicker.</p>
<p>Thanks guys!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://blog.flexexamples.com/2007/12/12/loading-cascading-style-sheets-on-the-fly-using-the-flex-stylemanager-class/comment-page-1/#comment-2112</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Mon, 27 Oct 2008 05:13:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/12/12/loading-cascading-style-sheets-on-the-fly-using-the-flex-stylemanager-class/#comment-2112</guid>
		<description>Jai,

You can get around the flicker of the default theme by doing the following:

1) In your Application tag, set creationPolicy=&quot;none&quot;
2) Set a preinitialize handler in your Application tag
3) Have the preinit handler load in your css file and set an oncomplete handler for the file
4) In the oncomplete handler, put this line of code: createComponentsFromDescriptors();

In short, this stops your application rendering until the css file is loaded.

HTH,
Mark</description>
		<content:encoded><![CDATA[<p>Jai,</p>
<p>You can get around the flicker of the default theme by doing the following:</p>
<p>1) In your Application tag, set creationPolicy=&#8221;none&#8221;<br />
2) Set a preinitialize handler in your Application tag<br />
3) Have the preinit handler load in your css file and set an oncomplete handler for the file<br />
4) In the oncomplete handler, put this line of code: createComponentsFromDescriptors();</p>
<p>In short, this stops your application rendering until the css file is loaded.</p>
<p>HTH,<br />
Mark</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jai</title>
		<link>http://blog.flexexamples.com/2007/12/12/loading-cascading-style-sheets-on-the-fly-using-the-flex-stylemanager-class/comment-page-1/#comment-2113</link>
		<dc:creator>Jai</dc:creator>
		<pubDate>Mon, 29 Sep 2008 07:40:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/12/12/loading-cascading-style-sheets-on-the-fly-using-the-flex-stylemanager-class/#comment-2113</guid>
		<description>Hi,

This is a great example. However, I see that that whenever I change the theme, the default theme shows up for a fraction of a second. Is there any way that can be removed. I want the transition to be smooth and direct. Please let me know if there is a solution to this.

cheers,</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>This is a great example. However, I see that that whenever I change the theme, the default theme shows up for a fraction of a second. Is there any way that can be removed. I want the transition to be smooth and direct. Please let me know if there is a solution to this.</p>
<p>cheers,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Benjamin</title>
		<link>http://blog.flexexamples.com/2007/12/12/loading-cascading-style-sheets-on-the-fly-using-the-flex-stylemanager-class/comment-page-1/#comment-2106</link>
		<dc:creator>Benjamin</dc:creator>
		<pubDate>Tue, 27 May 2008 10:39:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/12/12/loading-cascading-style-sheets-on-the-fly-using-the-flex-stylemanager-class/#comment-2106</guid>
		<description>&lt;pre class=&quot;code&quot;&gt;
var myEvent:IEventDispatcher = StyleManager.loadStyleDeclarations(&quot;./css/stylz.swf&quot;);
myEvent.addEventListener(StyleEvent.COMPLETE,this.stylesLoaded);
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<pre class="code">
var myEvent:IEventDispatcher = StyleManager.loadStyleDeclarations("./css/stylz.swf");
myEvent.addEventListener(StyleEvent.COMPLETE,this.stylesLoaded);
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Benjamin</title>
		<link>http://blog.flexexamples.com/2007/12/12/loading-cascading-style-sheets-on-the-fly-using-the-flex-stylemanager-class/comment-page-1/#comment-2107</link>
		<dc:creator>Benjamin</dc:creator>
		<pubDate>Fri, 23 May 2008 12:23:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/12/12/loading-cascading-style-sheets-on-the-fly-using-the-flex-stylemanager-class/#comment-2107</guid>
		<description>I want to attach an event listener to know when the style is loaded. Problem is where to attach it?
Something like this:
&lt;pre class=&quot;code&quot;&gt;
myApplication.addEventListener(StyleEvent.COMPLETE,this.stylesLoaded);

function stylesLoaded(e:StyleEvent):void
{
   Do something...
}
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>I want to attach an event listener to know when the style is loaded. Problem is where to attach it?<br />
Something like this:</p>
<pre class="code">
myApplication.addEventListener(StyleEvent.COMPLETE,this.stylesLoaded);

function stylesLoaded(e:StyleEvent):void
{
   Do something...
}
</pre>
]]></content:encoded>
	</item>
</channel>
</rss>

