<?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: Creating toggle and emphasized Button controls in Flex</title>
	<atom:link href="http://blog.flexexamples.com/2007/08/20/creating-toggle-and-emphasized-button-controls-in-flex/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com/2007/08/20/creating-toggle-and-emphasized-button-controls-in-flex/</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Sun, 12 Feb 2012 14:19:03 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Peter deHaan</title>
		<link>http://blog.flexexamples.com/2007/08/20/creating-toggle-and-emphasized-button-controls-in-flex/comment-page-1/#comment-5826</link>
		<dc:creator>Peter deHaan</dc:creator>
		<pubDate>Fri, 18 Sep 2009 14:00:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/08/20/creating-toggle-and-emphasized-button-controls-in-flex/#comment-5826</guid>
		<description>@Adam,

If you want to display Yes/No instead of true/false, you could do something similar to this:
&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:Script&gt;
        &lt;![CDATA[
            protected function setBtnLabel():void {
                btn.label = yesNoFormatter(btn.selected);
            }

            protected function yesNoFormatter(value:Boolean):String {
                return (value) ? &quot;yes&quot; : &quot;no&quot;;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Button id=&quot;btn&quot;
            toggle=&quot;true&quot;
            selected=&quot;true&quot;
            change=&quot;setBtnLabel();&quot;
            initialize=&quot;setBtnLabel();&quot; /&gt;

&lt;/mx:Application&gt;
&lt;/pre&gt;

Peter</description>
		<content:encoded><![CDATA[<p>@Adam,</p>
<p>If you want to display Yes/No instead of true/false, you could do something similar to this:</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: #339933;">&lt;mx:Script&gt;</span>
<span style="color: #339933;">        &lt;![CDATA[</span>
<span style="color: #339933;">            protected function setBtnLabel():void {</span>
<span style="color: #339933;">                btn.label = yesNoFormatter(btn.selected);</span>
<span style="color: #339933;">            }</span>
&nbsp;
<span style="color: #339933;">            protected function yesNoFormatter(value:Boolean):String {</span>
<span style="color: #339933;">                return (value) ? &quot;yes&quot; : &quot;no&quot;;</span>
<span style="color: #339933;">            }</span>
<span style="color: #339933;">        ]]&gt;</span>
<span style="color: #339933;">    &lt;/mx:Script&gt;</span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Button</span> id=<span style="color: #ff0000;">&quot;btn&quot;</span></span>
<span style="color: #000000;">            toggle=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #000000;">            selected=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #000000;">            change=<span style="color: #ff0000;">&quot;setBtnLabel();&quot;</span></span>
<span style="color: #000000;">            initialize=<span style="color: #ff0000;">&quot;setBtnLabel();&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: Adam</title>
		<link>http://blog.flexexamples.com/2007/08/20/creating-toggle-and-emphasized-button-controls-in-flex/comment-page-1/#comment-5824</link>
		<dc:creator>Adam</dc:creator>
		<pubDate>Fri, 18 Sep 2009 09:56:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/08/20/creating-toggle-and-emphasized-button-controls-in-flex/#comment-5824</guid>
		<description>hello,

i would like to know if it is possible to change the label with something else than the selected boolean value :
first click : the label is &#039;yes&#039;
second click  : the button  is &#039;no&#039;
third click : the label is &#039;yes&#039; etc...</description>
		<content:encoded><![CDATA[<p>hello,</p>
<p>i would like to know if it is possible to change the label with something else than the selected boolean value :<br />
first click : the label is &#8216;yes&#8217;<br />
second click  : the button  is &#8216;no&#8217;<br />
third click : the label is &#8216;yes&#8217; etc&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kayes</title>
		<link>http://blog.flexexamples.com/2007/08/20/creating-toggle-and-emphasized-button-controls-in-flex/comment-page-1/#comment-686</link>
		<dc:creator>kayes</dc:creator>
		<pubDate>Wed, 06 May 2009 16:06:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/08/20/creating-toggle-and-emphasized-button-controls-in-flex/#comment-686</guid>
		<description>thanks. much appreciated.</description>
		<content:encoded><![CDATA[<p>thanks. much appreciated.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

