<?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: Embedding Cascading Style Sheets in Flash/Flex</title>
	<atom:link href="http://blog.swfjunkie.com/2009/10/embedding-css-flex/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.swfjunkie.com/2009/10/embedding-css-flex/</link>
	<description>random gibberish for random people</description>
	<lastBuildDate>Wed, 18 Apr 2012 21:33:27 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Prabhu</title>
		<link>http://blog.swfjunkie.com/2009/10/embedding-css-flex/comment-page-1/#comment-444</link>
		<dc:creator>Prabhu</dc:creator>
		<pubDate>Mon, 03 Oct 2011 10:15:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.swfjunkie.com/?p=303#comment-444</guid>
		<description>This is my label.



And, Please tell me how to apply the style sheet to GLOBAL application not for the particular text or label. 

Hope anybody will help me...


Thanks,

Prabhu</description>
		<content:encoded><![CDATA[<p>This is my label.</p>
<p>And, Please tell me how to apply the style sheet to GLOBAL application not for the particular text or label. </p>
<p>Hope anybody will help me&#8230;</p>
<p>Thanks,</p>
<p>Prabhu</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Prabhu</title>
		<link>http://blog.swfjunkie.com/2009/10/embedding-css-flex/comment-page-1/#comment-443</link>
		<dc:creator>Prabhu</dc:creator>
		<pubDate>Mon, 03 Oct 2011 10:04:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.swfjunkie.com/?p=303#comment-443</guid>
		<description>Hi,

I am trying to include dynamic style sheet for my flex application. Till now i am not getting any solution. I am using Flex 4 version. 

This is my sample css file.

/* CSS file */
@namespace s &quot;library://ns.adobe.com/flex/spark&quot;;
@namespace mx &quot;library://ns.adobe.com/flex/mx&quot;;

mx&#124;Label.clsLabel {
	fontSize: 20;
	color: #7F4818;
}

My MXML file
============



I have tried the above createStyleSheetObject() function in the application. This function reads the css content and parse it then return the proper style sheet object. 

But the style is not applying for this Label text. Please help me to solve this problem.


Thanks,

Prabhu</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I am trying to include dynamic style sheet for my flex application. Till now i am not getting any solution. I am using Flex 4 version. </p>
<p>This is my sample css file.</p>
<p>/* CSS file */<br />
@namespace s &#8220;library://ns.adobe.com/flex/spark&#8221;;<br />
@namespace mx &#8220;library://ns.adobe.com/flex/mx&#8221;;</p>
<p>mx|Label.clsLabel {<br />
	fontSize: 20;<br />
	color: #7F4818;<br />
}</p>
<p>My MXML file<br />
============</p>
<p>I have tried the above createStyleSheetObject() function in the application. This function reads the css content and parse it then return the proper style sheet object. </p>
<p>But the style is not applying for this Label text. Please help me to solve this problem.</p>
<p>Thanks,</p>
<p>Prabhu</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rodislav</title>
		<link>http://blog.swfjunkie.com/2009/10/embedding-css-flex/comment-page-1/#comment-422</link>
		<dc:creator>Rodislav</dc:creator>
		<pubDate>Wed, 13 Apr 2011 08:18:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.swfjunkie.com/?p=303#comment-422</guid>
		<description>@Vickas

private var allStyles:Object = {}

public function getStyle(style_:Class):StyleSheet
{
    var className:String = String(style_)

    if(allStyles.hasOwnProperty(className) == false)
    {
        var styleSheet:StyleSheet = new StyleSheet();
        styleSheet.parseCSS(new style_().toString());
        allStyles[className] = styleSheet
    }

    return allStyles[className]
}

// then call this function

myTextField.styleSheet = getStyle(stylesCSS)

// if you want this more generic, then embed css in this way
// make everything static, and public
// class declaration ...
   ..CSSManager {
[Embed(source=&quot;assets/stylesheet.css&quot;, mimeType=&quot;application/octet-stream&quot;)]
public static var stylesCSS:Class;

public static function getStyle(...

// ...end class declaration
}

// then use it

myTextField.styleSheet = CSSManager.getStyle(CSSManager.stylesCSS)</description>
		<content:encoded><![CDATA[<p>@Vickas</p>
<p>private var allStyles:Object = {}</p>
<p>public function getStyle(style_:Class):StyleSheet<br />
{<br />
    var className:String = String(style_)</p>
<p>    if(allStyles.hasOwnProperty(className) == false)<br />
    {<br />
        var styleSheet:StyleSheet = new StyleSheet();<br />
        styleSheet.parseCSS(new style_().toString());<br />
        allStyles[className] = styleSheet<br />
    }</p>
<p>    return allStyles[className]<br />
}</p>
<p>// then call this function</p>
<p>myTextField.styleSheet = getStyle(stylesCSS)</p>
<p>// if you want this more generic, then embed css in this way<br />
// make everything static, and public<br />
// class declaration &#8230;<br />
   ..CSSManager {<br />
[Embed(source="assets/stylesheet.css", mimeType="application/octet-stream")]<br />
public static var stylesCSS:Class;</p>
<p>public static function getStyle(&#8230;</p>
<p>// &#8230;end class declaration<br />
}</p>
<p>// then use it</p>
<p>myTextField.styleSheet = CSSManager.getStyle(CSSManager.stylesCSS)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rodislav</title>
		<link>http://blog.swfjunkie.com/2009/10/embedding-css-flex/comment-page-1/#comment-421</link>
		<dc:creator>Rodislav</dc:creator>
		<pubDate>Wed, 13 Apr 2011 08:07:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.swfjunkie.com/?p=303#comment-421</guid>
		<description>And one thing :) is that cross platform !? because i met errors while working with utf bytes in *nix systems, where everything goes utf-8 by default.</description>
		<content:encoded><![CDATA[<p>And one thing :) is that cross platform !? because i met errors while working with utf bytes in *nix systems, where everything goes utf-8 by default.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rodislav</title>
		<link>http://blog.swfjunkie.com/2009/10/embedding-css-flex/comment-page-1/#comment-420</link>
		<dc:creator>Rodislav</dc:creator>
		<pubDate>Wed, 13 Apr 2011 08:04:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.swfjunkie.com/?p=303#comment-420</guid>
		<description>Hi, nice idea, what about memory/cpu usage !?</description>
		<content:encoded><![CDATA[<p>Hi, nice idea, what about memory/cpu usage !?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Flash Games Master</title>
		<link>http://blog.swfjunkie.com/2009/10/embedding-css-flex/comment-page-1/#comment-410</link>
		<dc:creator>Flash Games Master</dc:creator>
		<pubDate>Sun, 20 Feb 2011 23:02:16 +0000</pubDate>
		<guid isPermaLink="false">http://blog.swfjunkie.com/?p=303#comment-410</guid>
		<description>Hi Sandro

This is great and love it that you have answered Vikas question. This will be very useful. Cheers</description>
		<content:encoded><![CDATA[<p>Hi Sandro</p>
<p>This is great and love it that you have answered Vikas question. This will be very useful. Cheers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Games Up</title>
		<link>http://blog.swfjunkie.com/2009/10/embedding-css-flex/comment-page-1/#comment-252</link>
		<dc:creator>Games Up</dc:creator>
		<pubDate>Wed, 11 Aug 2010 14:07:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.swfjunkie.com/?p=303#comment-252</guid>
		<description>Thats exactly what I was looking for! Thanks a bunch mate. :-)</description>
		<content:encoded><![CDATA[<p>Thats exactly what I was looking for! Thanks a bunch mate. :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sandro</title>
		<link>http://blog.swfjunkie.com/2009/10/embedding-css-flex/comment-page-1/#comment-196</link>
		<dc:creator>Sandro</dc:creator>
		<pubDate>Thu, 14 Jan 2010 19:38:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.swfjunkie.com/?p=303#comment-196</guid>
		<description>Actually you can apply those stylesheets on Flex Text Objects. It requires a little trick though. Check out: &lt;a href=&quot;http://www.flexfreaks.com/forums/viewtopic.php?id=6&quot; rel=&quot;nofollow&quot;&gt;http://www.flexfreaks.com/forums/viewtopic.php?id=6&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Actually you can apply those stylesheets on Flex Text Objects. It requires a little trick though. Check out: <a href="http://www.flexfreaks.com/forums/viewtopic.php?id=6" rel="nofollow">http://www.flexfreaks.com/forums/viewtopic.php?id=6</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kellen Styler</title>
		<link>http://blog.swfjunkie.com/2009/10/embedding-css-flex/comment-page-1/#comment-193</link>
		<dc:creator>Kellen Styler</dc:creator>
		<pubDate>Sat, 09 Jan 2010 04:01:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.swfjunkie.com/?p=303#comment-193</guid>
		<description>I am assuming but this will only work when you set the styleSheet of a textInput / textArea.  This will not work on any Flex class.  right?</description>
		<content:encoded><![CDATA[<p>I am assuming but this will only work when you set the styleSheet of a textInput / textArea.  This will not work on any Flex class.  right?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sandro</title>
		<link>http://blog.swfjunkie.com/2009/10/embedding-css-flex/comment-page-1/#comment-154</link>
		<dc:creator>Sandro</dc:creator>
		<pubDate>Tue, 27 Oct 2009 12:09:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.swfjunkie.com/?p=303#comment-154</guid>
		<description>Hi Vikas

The Function/Method is just an example method. You could just execute the same code from within your init method or the first method you call when you instantiate the class that embeds the stylesheet. That part is entirely up to you. 

Concerning your question about how to implement multiple stylesheets: i updated the blog post to include an example of how i think would probably be the easiest approach to do that. 

Hope that helps you,
Sandro</description>
		<content:encoded><![CDATA[<p>Hi Vikas</p>
<p>The Function/Method is just an example method. You could just execute the same code from within your init method or the first method you call when you instantiate the class that embeds the stylesheet. That part is entirely up to you. </p>
<p>Concerning your question about how to implement multiple stylesheets: i updated the blog post to include an example of how i think would probably be the easiest approach to do that. </p>
<p>Hope that helps you,<br />
Sandro</p>
]]></content:encoded>
	</item>
</channel>
</rss>

