<?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: Flex WISHED It Supported CSS</title>
	<atom:link href="http://jacwright.com/blog/63/flex-wished-it-supported-css/feed/" rel="self" type="application/rss+xml" />
	<link>http://jacwright.com/blog/63/flex-wished-it-supported-css/</link>
	<description>Flex, AIR, PHP, etc.</description>
	<lastBuildDate>Thu, 11 Mar 2010 19:59:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Dan Orlando</title>
		<link>http://jacwright.com/blog/63/flex-wished-it-supported-css/comment-page-1/#comment-8923</link>
		<dc:creator>Dan Orlando</dc:creator>
		<pubDate>Mon, 21 Dec 2009 00:46:01 +0000</pubDate>
		<guid isPermaLink="false">http://jacwright.com/blog/63/flex-wished-it-supported-css/#comment-8923</guid>
		<description>Hah...the amazing thing is that so many Flex developers come from the world of web dev (including myself), and yet this is something that many of us just accepted as the way it is without a second thought. Not that doing so is a problem, it is the misuse of the CSS term that can cause confusion for future generations of developers. 

Kudos for pointing this out.
-Dan</description>
		<content:encoded><![CDATA[<p>Hah&#8230;the amazing thing is that so many Flex developers come from the world of web dev (including myself), and yet this is something that many of us just accepted as the way it is without a second thought. Not that doing so is a problem, it is the misuse of the CSS term that can cause confusion for future generations of developers. </p>
<p>Kudos for pointing this out.<br />
-Dan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kingschnulli</title>
		<link>http://jacwright.com/blog/63/flex-wished-it-supported-css/comment-page-1/#comment-8919</link>
		<dc:creator>kingschnulli</dc:creator>
		<pubDate>Sun, 20 Dec 2009 17:34:03 +0000</pubDate>
		<guid isPermaLink="false">http://jacwright.com/blog/63/flex-wished-it-supported-css/#comment-8919</guid>
		<description>I have build a little class that makes it possible to set properties through css, works for width/height but also for any other property if you use it carefully. Check it out here:

http://myflex.wordpress.com/2009/12/20/adding-width-height-x-and-y-into-the-css-model-of-flex/</description>
		<content:encoded><![CDATA[<p>I have build a little class that makes it possible to set properties through css, works for width/height but also for any other property if you use it carefully. Check it out here:</p>
<p><a href="http://myflex.wordpress.com/2009/12/20/adding-width-height-x-and-y-into-the-css-model-of-flex/" rel="nofollow">http://myflex.wordpress.com/2009/12/20/adding-width-height-x-and-y-into-the-css-model-of-flex/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nanu</title>
		<link>http://jacwright.com/blog/63/flex-wished-it-supported-css/comment-page-1/#comment-8681</link>
		<dc:creator>nanu</dc:creator>
		<pubDate>Tue, 24 Nov 2009 22:10:59 +0000</pubDate>
		<guid isPermaLink="false">http://jacwright.com/blog/63/flex-wished-it-supported-css/#comment-8681</guid>
		<description>Another misnomer from my perspective is runtime styling that Flex is capable of. In the real sense, this is not runtime styling, it is more runtime loading of canned stylesheets that have been precompiled using mxmlc - anything that requires a customer to compile is not dynamic from my perspective. 

In flex, there is no clean way to suck in a css that works perfectly when used at compile time but instead feed it at runtime to produce the same effect... Yes, I&#039;ve seen CSSParsers and all but none of them really work to the full extent required.

Yes you can use a urlloader, load the stylesheet and use the following pseudo code

var sheet = new StyleSheet();
sheet.parseCSS(cssdatareadfromurl);

var styleCount:int = sheet.stylenames.length;

for each style read into array
   currSelector = new CSSStyleDeclaration();
   set all styles using this selector
   i.e currSelector.setStyle(prop, value);

StyleManager.setStyleDeclaration(stylename, currSelector, true);

But you will notice that most of your styles do not work for many reasons.

1. The stylesheet parser lowercases all style selector names - so you cannot really use any of this stuff...

2. If you figure out a way to preserve the names, then things like gradients etc that require comma separated values would cause a runtime exception. 

3. To overcome problem 2, convert all comma separated values into arrays using the String.split() method. You will not see runtime exceptions anymore...

4. But gradients don&#039;t work, background images don&#039;t work, and many of the styles that work when used at compile time just do not work when fed into the style manager at runtime...

From my experience runtime styling or style overriding is a big can of worms (buggy code/design) using the Stylemanager.setStyle functionality...

If you are doing dainty things like changing the background color then there are no problems!</description>
		<content:encoded><![CDATA[<p>Another misnomer from my perspective is runtime styling that Flex is capable of. In the real sense, this is not runtime styling, it is more runtime loading of canned stylesheets that have been precompiled using mxmlc &#8211; anything that requires a customer to compile is not dynamic from my perspective. </p>
<p>In flex, there is no clean way to suck in a css that works perfectly when used at compile time but instead feed it at runtime to produce the same effect&#8230; Yes, I&#8217;ve seen CSSParsers and all but none of them really work to the full extent required.</p>
<p>Yes you can use a urlloader, load the stylesheet and use the following pseudo code</p>
<p>var sheet = new StyleSheet();<br />
sheet.parseCSS(cssdatareadfromurl);</p>
<p>var styleCount:int = sheet.stylenames.length;</p>
<p>for each style read into array<br />
   currSelector = new CSSStyleDeclaration();<br />
   set all styles using this selector<br />
   i.e currSelector.setStyle(prop, value);</p>
<p>StyleManager.setStyleDeclaration(stylename, currSelector, true);</p>
<p>But you will notice that most of your styles do not work for many reasons.</p>
<p>1. The stylesheet parser lowercases all style selector names &#8211; so you cannot really use any of this stuff&#8230;</p>
<p>2. If you figure out a way to preserve the names, then things like gradients etc that require comma separated values would cause a runtime exception. </p>
<p>3. To overcome problem 2, convert all comma separated values into arrays using the String.split() method. You will not see runtime exceptions anymore&#8230;</p>
<p>4. But gradients don&#8217;t work, background images don&#8217;t work, and many of the styles that work when used at compile time just do not work when fed into the style manager at runtime&#8230;</p>
<p>From my experience runtime styling or style overriding is a big can of worms (buggy code/design) using the Stylemanager.setStyle functionality&#8230;</p>
<p>If you are doing dainty things like changing the background color then there are no problems!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fahad Ansari</title>
		<link>http://jacwright.com/blog/63/flex-wished-it-supported-css/comment-page-1/#comment-8357</link>
		<dc:creator>Fahad Ansari</dc:creator>
		<pubDate>Wed, 20 May 2009 20:37:27 +0000</pubDate>
		<guid isPermaLink="false">http://jacwright.com/blog/63/flex-wished-it-supported-css/#comment-8357</guid>
		<description>I don&#039;t think it supports inheritance either. I may be wrong but it seems like I have to define background on every single component and it does not inherit background of the parent.

I just started working with Flex so I may be wrong..</description>
		<content:encoded><![CDATA[<p>I don&#8217;t think it supports inheritance either. I may be wrong but it seems like I have to define background on every single component and it does not inherit background of the parent.</p>
<p>I just started working with Flex so I may be wrong..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick Bilyk</title>
		<link>http://jacwright.com/blog/63/flex-wished-it-supported-css/comment-page-1/#comment-8086</link>
		<dc:creator>Nick Bilyk</dc:creator>
		<pubDate>Sat, 13 Sep 2008 03:45:29 +0000</pubDate>
		<guid isPermaLink="false">http://jacwright.com/blog/63/flex-wished-it-supported-css/#comment-8086</guid>
		<description>&quot;Flex is missing the &quot;Cascading&quot; part of it.&quot;

Too true, unfortunately.  Currently causing me a big headache.</description>
		<content:encoded><![CDATA[<p>&#8220;Flex is missing the &#8220;Cascading&#8221; part of it.&#8221;</p>
<p>Too true, unfortunately.  Currently causing me a big headache.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CSS Support in Flash 9 (actionscript3) &#124; leonardoPicado.com's blog</title>
		<link>http://jacwright.com/blog/63/flex-wished-it-supported-css/comment-page-1/#comment-7979</link>
		<dc:creator>CSS Support in Flash 9 (actionscript3) &#124; leonardoPicado.com's blog</dc:creator>
		<pubDate>Tue, 01 Jul 2008 18:13:44 +0000</pubDate>
		<guid isPermaLink="false">http://jacwright.com/blog/63/flex-wished-it-supported-css/#comment-7979</guid>
		<description>[...] they both use the same plugin and both use AS3 their lines are equal, however it seems that a lot of people feels my pain and would like for Flex (and obviously Flash as well) to support the CSS Level 2 [...]</description>
		<content:encoded><![CDATA[<p>[...] they both use the same plugin and both use AS3 their lines are equal, however it seems that a lot of people feels my pain and would like for Flex (and obviously Flash as well) to support the CSS Level 2 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jacob Wright</title>
		<link>http://jacwright.com/blog/63/flex-wished-it-supported-css/comment-page-1/#comment-6762</link>
		<dc:creator>Jacob Wright</dc:creator>
		<pubDate>Mon, 21 Jan 2008 17:18:20 +0000</pubDate>
		<guid isPermaLink="false">http://jacwright.com/blog/63/flex-wished-it-supported-css/#comment-6762</guid>
		<description>Lordy - I know, I was there for it at MAX. I am very excited about that step if they go with it. However, that is only a part of what I hope Flex will support.

Update - We have 16 votes for this feature request so far. That brings the feature up to #4 in the Flex bug-base.</description>
		<content:encoded><![CDATA[<p>Lordy &#8211; I know, I was there for it at MAX. I am very excited about that step if they go with it. However, that is only a part of what I hope Flex will support.</p>
<p>Update &#8211; We have 16 votes for this feature request so far. That brings the feature up to #4 in the Flex bug-base.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lordy</title>
		<link>http://jacwright.com/blog/63/flex-wished-it-supported-css/comment-page-1/#comment-6715</link>
		<dc:creator>Lordy</dc:creator>
		<pubDate>Fri, 18 Jan 2008 17:22:09 +0000</pubDate>
		<guid isPermaLink="false">http://jacwright.com/blog/63/flex-wished-it-supported-css/#comment-6715</guid>
		<description>See Ely greenfields, flex roadmap session where he talks about implmenting pseudo selectors, with (possibly) new MVC style components. 

http://www.onflexwithcf.org/index.cfm/2007/10/19/Flex-Roadmap-presented-by-Ely-Greenfield--Videos</description>
		<content:encoded><![CDATA[<p>See Ely greenfields, flex roadmap session where he talks about implmenting pseudo selectors, with (possibly) new MVC style components. </p>
<p><a href="http://www.onflexwithcf.org/index.cfm/2007/10/19/Flex-Roadmap-presented-by-Ely-Greenfield--Videos" rel="nofollow">http://www.onflexwithcf.org/index.cfm/2007/10/19/Flex-Roadmap-presented-by-Ely-Greenfield&#8211;Videos</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
