<?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: Setting a Flex application&#8217;s style name</title>
	<atom:link href="http://blog.flexexamples.com/2007/09/18/setting-a-flex-applications-style-name/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com/2007/09/18/setting-a-flex-applications-style-name/</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Fri, 19 Mar 2010 20:35:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Paul</title>
		<link>http://blog.flexexamples.com/2007/09/18/setting-a-flex-applications-style-name/comment-page-1/#comment-6415</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Fri, 20 Nov 2009 09:43:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/09/18/setting-a-flex-applications-style-name/#comment-6415</guid>
		<description>Hi Peter!

Thanks for the suggestion. Was not able to try it though, I just ended up using ActionScript to update the values like in your example.

Keep the great articles coming! :)</description>
		<content:encoded><![CDATA[<p>Hi Peter!</p>
<p>Thanks for the suggestion. Was not able to try it though, I just ended up using ActionScript to update the values like in your example.</p>
<p>Keep the great articles coming! :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter deHaan</title>
		<link>http://blog.flexexamples.com/2007/09/18/setting-a-flex-applications-style-name/comment-page-1/#comment-6213</link>
		<dc:creator>Peter deHaan</dc:creator>
		<pubDate>Tue, 03 Nov 2009 14:53:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/09/18/setting-a-flex-applications-style-name/#comment-6213</guid>
		<description>@Paul,

Try using data binding:
&lt;pre lang=&quot;mxml&quot;&gt;
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;&gt;

    &lt;mx:Style&gt;
        .style1 {
            color: red;
            fontSize: 32;
            fontWeight: bold;
        }

        .style2 {
            color: green;
            fontSize: 40;
            fontStyle: italic;
        }
    &lt;/mx:Style&gt;

    &lt;mx:ApplicationControlBar dock=&quot;true&quot;&gt;
        &lt;mx:CheckBox id=&quot;ch1&quot; label=&quot;check1&quot; /&gt;
        &lt;mx:CheckBox id=&quot;ch2&quot; label=&quot;check2&quot; /&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:Button label=&quot;Button&quot; styleName=&quot;{(ch1.selected &#124;&#124; ch2.selected) ? &#039;style1&#039; : &#039;style2&#039;}&quot; /&gt;

&lt;/mx:Application&gt;
&lt;/pre&gt;

Peter</description>
		<content:encoded><![CDATA[<p>@Paul,</p>
<p>Try using data binding:</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Style</span><span style="color: #7400FF;">&gt;</span></span>
        .style1 {
            color: red;
            fontSize: 32;
            fontWeight: bold;
        }
&nbsp;
        .style2 {
            color: green;
            fontSize: 40;
            fontStyle: italic;
        }
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Style</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ApplicationControlBar</span> dock=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:CheckBox</span> id=<span style="color: #ff0000;">&quot;ch1&quot;</span> label=<span style="color: #ff0000;">&quot;check1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:CheckBox</span> id=<span style="color: #ff0000;">&quot;ch2&quot;</span> label=<span style="color: #ff0000;">&quot;check2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ApplicationControlBar</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Button</span> label=<span style="color: #ff0000;">&quot;Button&quot;</span> styleName=<span style="color: #ff0000;">&quot;{(ch1.selected || ch2.selected) ? 'style1' : 'style2'}&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul</title>
		<link>http://blog.flexexamples.com/2007/09/18/setting-a-flex-applications-style-name/comment-page-1/#comment-6208</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Tue, 03 Nov 2009 03:09:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/09/18/setting-a-flex-applications-style-name/#comment-6208</guid>
		<description>Is it possible to have conditionals inside styleName? 

&lt;code&gt;styleName=&quot;check1 &#124;&#124; check2 ? &#039;style1&#039; : &#039;style2&#039;&quot;&lt;/code&gt;

I can&#039;t seem to make this approach work, I don&#039;t see any compile errors but the styles are not being applied.

Thanks for your time.

-Paul</description>
		<content:encoded><![CDATA[<p>Is it possible to have conditionals inside styleName? </p>
<p><code>styleName="check1 || check2 ? 'style1' : 'style2'"</code></p>
<p>I can&#8217;t seem to make this approach work, I don&#8217;t see any compile errors but the styles are not being applied.</p>
<p>Thanks for your time.</p>
<p>-Paul</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peterd</title>
		<link>http://blog.flexexamples.com/2007/09/18/setting-a-flex-applications-style-name/comment-page-1/#comment-1162</link>
		<dc:creator>peterd</dc:creator>
		<pubDate>Wed, 19 Dec 2007 15:54:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/09/18/setting-a-flex-applications-style-name/#comment-1162</guid>
		<description>Jesse,

Yes, you can apply a style to a single Button on control/container by setting the &lt;code&gt;styleName&lt;/code&gt; property, such as:

&lt;pre class=&quot;code&quot;&gt;
&lt;mx:Button label=&quot;Custom styled&quot; styleName=&quot;myStyleName&quot; /&gt;
&lt;mx:Button label=&quot;Default styled&quot; /&gt;

&lt;mx:Style&gt;
    .myStyleName {
        color: red;
    }
&lt;/mx:Style&gt;
&lt;/pre&gt;

Hope that helps,
Peter</description>
		<content:encoded><![CDATA[<p>Jesse,</p>
<p>Yes, you can apply a style to a single Button on control/container by setting the <code>styleName</code> property, such as:</p>
<pre class="code">
&lt;mx:Button label="Custom styled" styleName="myStyleName" /&gt;
&lt;mx:Button label="Default styled" /&gt;

&lt;mx:Style&gt;
    .myStyleName {
        color: red;
    }
&lt;/mx:Style&gt;
</pre>
<p>Hope that helps,<br />
Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jesse</title>
		<link>http://blog.flexexamples.com/2007/09/18/setting-a-flex-applications-style-name/comment-page-1/#comment-1163</link>
		<dc:creator>Jesse</dc:creator>
		<pubDate>Wed, 19 Dec 2007 15:00:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/09/18/setting-a-flex-applications-style-name/#comment-1163</guid>
		<description>Is there a way to change the style dynamically like this on just one component? Say I just wanted to change the style of button 1 but not the other two?</description>
		<content:encoded><![CDATA[<p>Is there a way to change the style dynamically like this on just one component? Say I just wanted to change the style of button 1 but not the other two?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John C. Bland II</title>
		<link>http://blog.flexexamples.com/2007/09/18/setting-a-flex-applications-style-name/comment-page-1/#comment-1161</link>
		<dc:creator>John C. Bland II</dc:creator>
		<pubDate>Fri, 21 Sep 2007 07:55:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/09/18/setting-a-flex-applications-style-name/#comment-1161</guid>
		<description>Ok...I figured could just put it up there but I wasn&#039;t sure since you were using setStyle().

Koo on posting code. I&#039;ll keep that in mind.</description>
		<content:encoded><![CDATA[<p>Ok&#8230;I figured could just put it up there but I wasn&#8217;t sure since you were using setStyle().</p>
<p>Koo on posting code. I&#8217;ll keep that in mind.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peterd</title>
		<link>http://blog.flexexamples.com/2007/09/18/setting-a-flex-applications-style-name/comment-page-1/#comment-1160</link>
		<dc:creator>peterd</dc:creator>
		<pubDate>Wed, 19 Sep 2007 14:05:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/09/18/setting-a-flex-applications-style-name/#comment-1160</guid>
		<description>Yeah, you can just do this if you want:

&lt;pre class=&quot;code&quot;&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;
        layout=&quot;vertical&quot;
        verticalAlign=&quot;middle&quot;
        horizontalAlign=&quot;center&quot;
        styleName=&quot;plain&quot;&gt;
    ...
&lt;/mx:Application&gt;
&lt;/pre&gt;

Peter

PS: The trick to posting code is to change all your &lt; characters to &quot;[&quot; or &quot;&lt;&quot;.</description>
		<content:encoded><![CDATA[<p>Yeah, you can just do this if you want:</p>
<pre class="code">
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        horizontalAlign="center"
        styleName="plain"&gt;
    ...
&lt;/mx:Application&gt;
</pre>
<p>Peter</p>
<p>PS: The trick to posting code is to change all your &lt; characters to &#8220;[&#8221; or &#8220;&amp;lt;&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John C. Bland II</title>
		<link>http://blog.flexexamples.com/2007/09/18/setting-a-flex-applications-style-name/comment-page-1/#comment-1159</link>
		<dc:creator>John C. Bland II</dc:creator>
		<pubDate>Wed, 19 Sep 2007 08:09:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/09/18/setting-a-flex-applications-style-name/#comment-1159</guid>
		<description>ok dude...I give up on pasting code. :-) Basically, can you set styleName=&quot;plain&quot; in the initial mx:Application tag?

Sorry for the multiple comments.</description>
		<content:encoded><![CDATA[<p>ok dude&#8230;I give up on pasting code. :-) Basically, can you set styleName=&#8221;plain&#8221; in the initial mx:Application tag?</p>
<p>Sorry for the multiple comments.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John C. Bland II</title>
		<link>http://blog.flexexamples.com/2007/09/18/setting-a-flex-applications-style-name/comment-page-1/#comment-1158</link>
		<dc:creator>John C. Bland II</dc:creator>
		<pubDate>Wed, 19 Sep 2007 07:14:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/09/18/setting-a-flex-applications-style-name/#comment-1158</guid>
		<description>Does this work just the same but from the initial load?

&lt;pre class=&quot;code&quot;&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;
        layout=&quot;vertical&quot;
        verticalAlign=&quot;middle&quot;
        horizontalAlign=&quot;center&quot;&gt;

    …

&lt;/mx:Application&gt;
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Does this work just the same but from the initial load?</p>
<pre class="code">
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        horizontalAlign="center"&gt;

    …

&lt;/mx:Application&gt;
</pre>
]]></content:encoded>
	</item>
</channel>
</rss>
