<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.1" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Loading cascading style sheets on the fly using the Flex StyleManager class</title>
	<link>http://blog.flexexamples.com/2007/12/12/loading-cascading-style-sheets-on-the-fly-using-the-flex-stylemanager-class/</link>
	<description>A bunch of examples for Adobe Flex and ActionScript</description>
	<pubDate>Thu, 08 Jan 2009 12:12:37 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.1</generator>

	<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-16418</link>
		<author>Mark</author>
		<pubDate>Mon, 27 Oct 2008 05:13:49 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/12/12/loading-cascading-style-sheets-on-the-fly-using-the-flex-stylemanager-class/#comment-16418</guid>
		<description>Jai,

You can get around the flicker of the default theme by doing the following:

1) In your Application tag, set creationPolicy="none"
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-15931</link>
		<author>Jai</author>
		<pubDate>Mon, 29 Sep 2008 07:40:20 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/12/12/loading-cascading-style-sheets-on-the-fly-using-the-flex-stylemanager-class/#comment-15931</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-13013</link>
		<author>Benjamin</author>
		<pubDate>Tue, 27 May 2008 10:39:32 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/12/12/loading-cascading-style-sheets-on-the-fly-using-the-flex-stylemanager-class/#comment-13013</guid>
		<description>&lt;pre class="code"&gt;
var myEvent:IEventDispatcher = StyleManager.loadStyleDeclarations("./css/stylz.swf");
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-12908</link>
		<author>Benjamin</author>
		<pubDate>Fri, 23 May 2008 12:23:30 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/12/12/loading-cascading-style-sheets-on-the-fly-using-the-flex-stylemanager-class/#comment-12908</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="code"&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>
	<item>
		<title>By: Brady White</title>
		<link>http://blog.flexexamples.com/2007/12/12/loading-cascading-style-sheets-on-the-fly-using-the-flex-stylemanager-class/#comment-12340</link>
		<author>Brady White</author>
		<pubDate>Mon, 28 Apr 2008 17:05:21 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/12/12/loading-cascading-style-sheets-on-the-fly-using-the-flex-stylemanager-class/#comment-12340</guid>
		<description>Loading a CSS Font Swfs from a remote domain, getting this error:
Unable to load style(SWF is not a loadable module)

Please post solution asap ;)</description>
		<content:encoded><![CDATA[<p>Loading a CSS Font Swfs from a remote domain, getting this error:<br />
Unable to load style(SWF is not a loadable module)</p>
<p>Please post solution asap ;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Samuel Asher Rivello</title>
		<link>http://blog.flexexamples.com/2007/12/12/loading-cascading-style-sheets-on-the-fly-using-the-flex-stylemanager-class/#comment-12293</link>
		<author>Samuel Asher Rivello</author>
		<pubDate>Fri, 25 Apr 2008 22:25:33 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/12/12/loading-cascading-style-sheets-on-the-fly-using-the-flex-stylemanager-class/#comment-12293</guid>
		<description>Hi,

  Great, simple example.  I'm working on something similar; an application that loads runtime css.swf.  When the loader and css.swf are online it works fine, and when the loader and the css.swf are offline it works fine.  However when the loader is offline and the css.swf is online I get the following error.  This situation is desired as it contracts me to use the 'live' styles while I do updates on my loader from my desktop.  I can recopy my online css.swf to the offline as a workaround, but that is less desirable.  I want to fix the issue so that the loader can be offline and the css.swf can be online.  Typically in flash this type of operation (for everything except this css.swf workflow) works fine in my experience.  As far as I can tell its because the css.swf does not 'allow' itself, security-wise to be loaded.  The css.swf has no as3 scope of course (because its based in a *.css file) so I can't use Security.allowDomain('*').  Likewise it doesn't call a crossdomain automatically either.

ERROR:
Error: Unable to load style(SWF is not a loadable module): http://images50.neopets.com/style_set_manager/styles_EN_v1.swf.

QUESTION:
Anyone know how to get this to work?  I'll check back to this blog daily, and post the solution here if I find it elsewhere.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>  Great, simple example.  I&#8217;m working on something similar; an application that loads runtime css.swf.  When the loader and css.swf are online it works fine, and when the loader and the css.swf are offline it works fine.  However when the loader is offline and the css.swf is online I get the following error.  This situation is desired as it contracts me to use the &#8216;live&#8217; styles while I do updates on my loader from my desktop.  I can recopy my online css.swf to the offline as a workaround, but that is less desirable.  I want to fix the issue so that the loader can be offline and the css.swf can be online.  Typically in flash this type of operation (for everything except this css.swf workflow) works fine in my experience.  As far as I can tell its because the css.swf does not &#8216;allow&#8217; itself, security-wise to be loaded.  The css.swf has no as3 scope of course (because its based in a *.css file) so I can&#8217;t use Security.allowDomain(&#8217;*').  Likewise it doesn&#8217;t call a crossdomain automatically either.</p>
<p>ERROR:<br />
Error: Unable to load style(SWF is not a loadable module): <a href="http://images50.neopets.com/style_set_manager/styles_EN_v1.swf." rel="nofollow">http://images50.neopets.com/style_set_manager/styles_EN_v1.swf.</a></p>
<p>QUESTION:<br />
Anyone know how to get this to work?  I&#8217;ll check back to this blog daily, and post the solution here if I find it elsewhere.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peterd</title>
		<link>http://blog.flexexamples.com/2007/12/12/loading-cascading-style-sheets-on-the-fly-using-the-flex-stylemanager-class/#comment-10623</link>
		<author>peterd</author>
		<pubDate>Sun, 06 Apr 2008 07:29:14 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/12/12/loading-cascading-style-sheets-on-the-fly-using-the-flex-stylemanager-class/#comment-10623</guid>
		<description>Deden,

Sure, go ahead.

Peter</description>
		<content:encoded><![CDATA[<p>Deden,</p>
<p>Sure, go ahead.</p>
<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Deden</title>
		<link>http://blog.flexexamples.com/2007/12/12/loading-cascading-style-sheets-on-the-fly-using-the-flex-stylemanager-class/#comment-10611</link>
		<author>Deden</author>
		<pubDate>Sun, 06 Apr 2008 06:19:41 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/12/12/loading-cascading-style-sheets-on-the-fly-using-the-flex-stylemanager-class/#comment-10611</guid>
		<description>I'm from indonesia. It's very interesting to see this article. I like it. I was looking for the article like tis everywhere on net. I want to permit with you, can you give me a permission to copy your article to my homework please.??

Sorry if my english bad because i only can speak english a little.


Regards
Deden</description>
		<content:encoded><![CDATA[<p>I&#8217;m from indonesia. It&#8217;s very interesting to see this article. I like it. I was looking for the article like tis everywhere on net. I want to permit with you, can you give me a permission to copy your article to my homework please.??</p>
<p>Sorry if my english bad because i only can speak english a little.</p>
<p>Regards<br />
Deden</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Almog Kurtser</title>
		<link>http://blog.flexexamples.com/2007/12/12/loading-cascading-style-sheets-on-the-fly-using-the-flex-stylemanager-class/#comment-5053</link>
		<author>Almog Kurtser</author>
		<pubDate>Thu, 13 Dec 2007 19:49:54 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/12/12/loading-cascading-style-sheets-on-the-fly-using-the-flex-stylemanager-class/#comment-5053</guid>
		<description>Hi Peter,

That's really nice example, I have a question which is not directly related to this example:
I have an app that dynamically loads a compiled css swf at app startup.
Well, it works just fune, but it would be much more slick to load swf before the flex preloader completes. Do you think this can be done without changing the flex framework (yuk!) ?


Thanks,

Almog.</description>
		<content:encoded><![CDATA[<p>Hi Peter,</p>
<p>That&#8217;s really nice example, I have a question which is not directly related to this example:<br />
I have an app that dynamically loads a compiled css swf at app startup.<br />
Well, it works just fune, but it would be much more slick to load swf before the flex preloader completes. Do you think this can be done without changing the flex framework (yuk!) ?</p>
<p>Thanks,</p>
<p>Almog.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
