<?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: Changing a Button control&#8217;s icon when the button is disabled</title>
	<link>http://blog.flexexamples.com/2007/11/02/changing-a-button-controls-icon-when-the-button-is-disabled/</link>
	<description>A bunch of examples for Adobe Flex and ActionScript</description>
	<pubDate>Sat, 22 Nov 2008 08:25:49 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.1</generator>

	<item>
		<title>By: peterd</title>
		<link>http://blog.flexexamples.com/2007/11/02/changing-a-button-controls-icon-when-the-button-is-disabled/#comment-12289</link>
		<author>peterd</author>
		<pubDate>Fri, 25 Apr 2008 15:12:39 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/11/02/changing-a-button-controls-icon-when-the-button-is-disabled/#comment-12289</guid>
		<description>&lt;a href="http://blog.flexexamples.com/2007/11/02/changing-a-button-controls-icon-when-the-button-is-disabled/#comment-12285" rel="nofollow"&gt;Visi&lt;/a&gt;,

Does this work for you?
&lt;pre class="code"&gt;
&#60;mx:Script&#62;
    &#60;![CDATA[
        private function hasData(btn:Button):Boolean {
            return (btn.data != null) &#038;&#038; String(btn.data).length &#62; 0;
        }
    ]]&#62;
&#60;/mx:Script&#62;

&#60;mx:Form&#62;
    &#60;mx:FormItem label="button 1 (default - null):"&#62;
        &#60;mx:Button id="btn1"
                label="Que?"
                visible="{hasData(btn1)}" /&#62;
    &#60;/mx:FormItem&#62;
    &#60;mx:FormItem label="button 2 (empty):"&#62;
        &#60;mx:Button id="btn2"
                data=""
                label="Que?"
                visible="{hasData(btn2)}" /&#62;
    &#60;/mx:FormItem&#62;
    &#60;mx:FormItem label="button 3 (defined):"&#62;
        &#60;mx:Button id="btn3"
                data="value"
                label="Que?"
                visible="{hasData(btn3)}" /&#62;
    &#60;/mx:FormItem&#62;
&#60;/mx:Form&#62;
&lt;/pre&gt;

Peter</description>
		<content:encoded><![CDATA[<p><a href="http://blog.flexexamples.com/2007/11/02/changing-a-button-controls-icon-when-the-button-is-disabled/#comment-12285" rel="nofollow">Visi</a>,</p>
<p>Does this work for you?</p>
<pre class="code">
&lt;mx:Script&gt;
    &lt;![CDATA[
        private function hasData(btn:Button):Boolean {
            return (btn.data != null) &#038;&#038; String(btn.data).length &gt; 0;
        }
    ]]&gt;
&lt;/mx:Script&gt;

&lt;mx:Form&gt;
    &lt;mx:FormItem label="button 1 (default - null):"&gt;
        &lt;mx:Button id="btn1"
                label="Que?"
                visible="{hasData(btn1)}" /&gt;
    &lt;/mx:FormItem&gt;
    &lt;mx:FormItem label="button 2 (empty):"&gt;
        &lt;mx:Button id="btn2"
                data=""
                label="Que?"
                visible="{hasData(btn2)}" /&gt;
    &lt;/mx:FormItem&gt;
    &lt;mx:FormItem label="button 3 (defined):"&gt;
        &lt;mx:Button id="btn3"
                data="value"
                label="Que?"
                visible="{hasData(btn3)}" /&gt;
    &lt;/mx:FormItem&gt;
&lt;/mx:Form&gt;
</pre>
<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Visi</title>
		<link>http://blog.flexexamples.com/2007/11/02/changing-a-button-controls-icon-when-the-button-is-disabled/#comment-12285</link>
		<author>Visi</author>
		<pubDate>Fri, 25 Apr 2008 12:37:48 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/11/02/changing-a-button-controls-icon-when-the-button-is-disabled/#comment-12285</guid>
		<description>It is really a nice attempt to hide the text.
In addition to this I have a query .
I want to display a button only when data is present in the data field.
Button will not appear when there is no data in the data field.


Thanks in Advacnce for the help
Hope to hear soon 

Visi</description>
		<content:encoded><![CDATA[<p>It is really a nice attempt to hide the text.<br />
In addition to this I have a query .<br />
I want to display a button only when data is present in the data field.<br />
Button will not appear when there is no data in the data field.</p>
<p>Thanks in Advacnce for the help<br />
Hope to hear soon </p>
<p>Visi</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gregui Shigunov</title>
		<link>http://blog.flexexamples.com/2007/11/02/changing-a-button-controls-icon-when-the-button-is-disabled/#comment-5045</link>
		<author>Gregui Shigunov</author>
		<pubDate>Thu, 13 Dec 2007 17:15:15 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/11/02/changing-a-button-controls-icon-when-the-button-is-disabled/#comment-5045</guid>
		<description>Great Blog!
Congratulation!!!</description>
		<content:encoded><![CDATA[<p>Great Blog!<br />
Congratulation!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Beale</title>
		<link>http://blog.flexexamples.com/2007/11/02/changing-a-button-controls-icon-when-the-button-is-disabled/#comment-3830</link>
		<author>David Beale</author>
		<pubDate>Sat, 03 Nov 2007 12:34:26 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/11/02/changing-a-button-controls-icon-when-the-button-is-disabled/#comment-3830</guid>
		<description>I posted about how to do this automatically here http://www.bealearts.co.uk/blog/2007/07/29/automatic-disabled-icon-with-flex-button-control/</description>
		<content:encoded><![CDATA[<p>I posted about how to do this automatically here <a href="http://www.bealearts.co.uk/blog/2007/07/29/automatic-disabled-icon-with-flex-button-control/" rel="nofollow">http://www.bealearts.co.uk/blog/2007/07/29/automatic-disabled-icon-with-flex-button-control/</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
