<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Flex Examples &#187; CheckBox</title>
	<atom:link href="http://blog.flexexamples.com/category/halo/checkbox/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Wed, 26 Jan 2011 18:09:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Setting the fill colors on a CheckBox control in Flex</title>
		<link>http://blog.flexexamples.com/2009/01/26/setting-the-fill-colors-on-a-checkbox-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2009/01/26/setting-the-fill-colors-on-a-checkbox-control-in-flex/#comments</comments>
		<pubDate>Tue, 27 Jan 2009 07:54:37 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[CheckBox]]></category>
		<category><![CDATA[fillColors]]></category>
		<category><![CDATA[themeColor]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2009/01/26/setting-the-fill-colors-on-a-checkbox-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can set the check box fill colors on a Flex CheckBox control by setting the fillColors style.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2009/01/26/setting-the-fill-colors-on-a-checkbox-control-in-flex/ --&#62; &#60;mx:Application name="CheckBox_fillColors_test" xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:CheckBox id="checkBox" label="CheckBox" fillColors="[red,haloOrange,yellow,haloGreen]" themeColor="black" /&#62; &#60;/mx:Application&#62; <p>You can also [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the check box fill colors on a Flex CheckBox control by setting the <code>fillColors</code> style.</p>
<p>Full code after the jump.</p>
<p><span id="more-944"></span></p>
<p class="download"><a href="">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2009/01/26/setting-the-fill-colors-on-a-checkbox-control-in-flex/ --&gt;
&lt;mx:Application name="CheckBox_fillColors_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:CheckBox id="checkBox"
            label="CheckBox"
            fillColors="[red,haloOrange,yellow,haloGreen]"
            themeColor="black" /&gt;

&lt;/mx:Application&gt;
</pre>
<p>You can also set the <code>fillColors</code> style in an external .CSS file or &lt;Style&gt; block, as seen in the following example:</p>
<p class="download"><a href="">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2009/01/26/setting-the-fill-colors-on-a-checkbox-control-in-flex/ --&gt;
&lt;mx:Application name="CheckBox_fillColors_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        CheckBox {
            fillColors: red,haloOrange,yellow,haloGreen;
            themeColor: black;
        }
    &lt;/mx:Style&gt;

    &lt;mx:CheckBox id="checkBox"
            label="CheckBox" /&gt;

&lt;/mx:Application&gt;
</pre>
<p>Or, you can set the <code>fillColors</code> style using ActionScript, as seen in the following example:</p>
<p class="download"><a href="">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2009/01/26/setting-the-fill-colors-on-a-checkbox-control-in-flex/ --&gt;
&lt;mx:Application name="CheckBox_fillColors_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            private function init():void {
                checkBox.setStyle("fillColors",
                        ["red", "haloOrange", "yellow", "haloGreen"]);
                checkBox.setStyle("themeColor", "black");
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:CheckBox id="checkBox"
            label="CheckBox"
            initialize="init();" /&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting the fill colors on a CheckBox control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/01/26/setting-the-fill-colors-on-a-checkbox-control-in-flex/',contentID: 'post-944',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'fillColors,themeColor',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2009/01/26/setting-the-fill-colors-on-a-checkbox-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting the label color on a CheckBox control in Flex</title>
		<link>http://blog.flexexamples.com/2009/01/25/setting-the-label-color-on-a-checkbox-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2009/01/25/setting-the-label-color-on-a-checkbox-control-in-flex/#comments</comments>
		<pubDate>Mon, 26 Jan 2009 07:05:13 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[CheckBox]]></category>
		<category><![CDATA[Color]]></category>
		<category><![CDATA[styleName]]></category>
		<category><![CDATA[textRollOverColor]]></category>
		<category><![CDATA[textSelectedColor]]></category>
		<category><![CDATA[themeColor]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2009/01/25/setting-the-label-color-on-a-checkbox-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can set the text and theme color on a Flex CheckBox control based on whether the control is selected or not.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2009/01/25/setting-the-label-color-on-a-checkbox-control-in-flex/ --&#62; &#60;mx:Application name="CheckBox_color_test" xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Style&#62; CheckBox { fontWeight: bold; iconColor: [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the text and theme color on a Flex CheckBox control based on whether the control is selected or not.</p>
<p>Full code after the jump.</p>
<p><span id="more-943"></span></p>
<p class="download"><a href="">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2009/01/25/setting-the-label-color-on-a-checkbox-control-in-flex/ --&gt;
&lt;mx:Application name="CheckBox_color_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        CheckBox {
            fontWeight: bold;
            iconColor: green;
        }

        .selectedStyle {
            color: green;
            textRollOverColor: green;
            textSelectedColor: green;
            themeColor: green;
        }

        .unselectedStyle {
            color: red;
            textRollOverColor: red;
            textSelectedColor: red;
            themeColor: red;
        }
    &lt;/mx:Style&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            private function checkBox_change(evt:Event):void {
                var tgt:CheckBox = evt.currentTarget as CheckBox;
                if (tgt.selected) {
                    tgt.styleName = "selectedStyle";
                } else {
                    tgt.styleName = "unselectedStyle";
                }
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:CheckBox id="checkBox"
            label="CheckBox"
            selected="false"
            styleName="unselectedStyle"
            change="checkBox_change(event);" /&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting the label color on a CheckBox control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/01/25/setting-the-label-color-on-a-checkbox-control-in-flex/',contentID: 'post-943',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'styleName,textRollOverColor,textSelectedColor,themeColor',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2009/01/25/setting-the-label-color-on-a-checkbox-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Setting the disabled text color on a CheckBox control in Flex</title>
		<link>http://blog.flexexamples.com/2009/01/24/setting-the-disabled-text-color-on-a-checkbox-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2009/01/24/setting-the-disabled-text-color-on-a-checkbox-control-in-flex/#comments</comments>
		<pubDate>Sun, 25 Jan 2009 07:34:13 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[CheckBox]]></category>
		<category><![CDATA[disabledColor]]></category>
		<category><![CDATA[enabled]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2009/01/24/setting-the-disabled-text-color-on-a-checkbox-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can set the text color on a disabled Flex CheckBox control by setting the disabledColor style.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2009/01/24/setting-the-disabled-text-color-on-a-checkbox-control-in-flex/ --&#62; &#60;mx:Application name="CheckBox_disabledColor_test" xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:ApplicationControlBar dock="true"&#62; &#60;mx:Form styleName="plain"&#62; &#60;mx:FormItem label="disabledColor:"&#62; &#60;mx:ColorPicker id="colorPicker" selectedColor="red" /&#62; &#60;/mx:FormItem&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the text color on a disabled Flex CheckBox control by setting the <code>disabledColor</code> style.</p>
<p>Full code after the jump.</p>
<p><span id="more-942"></span></p>
<p class="download"><a href="">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2009/01/24/setting-the-disabled-text-color-on-a-checkbox-control-in-flex/ --&gt;
&lt;mx:Application name="CheckBox_disabledColor_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="disabledColor:"&gt;
                &lt;mx:ColorPicker id="colorPicker"
                        selectedColor="red" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="enabled:"&gt;
                &lt;mx:CheckBox id="checkBox"
                        selected="false" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:CheckBox id="checkBox2"
            label="CheckBox"
            selected="true"
            enabled="{checkBox.selected}"
            disabledColor="{colorPicker.selectedColor}" /&gt;

&lt;/mx:Application&gt;
</pre>
<p>You can also set the <code>disabledColor</code> style in an external .CSS file or &lt;Style/&gt; block, as seen in the following example:</p>
<p class="download"><a href="">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2009/01/24/setting-the-disabled-text-color-on-a-checkbox-control-in-flex/ --&gt;
&lt;mx:Application name="CheckBox_disabledColor_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        CheckBox {
            disabledColor: red;
        }
    &lt;/mx:Style&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="enabled:"&gt;
                &lt;mx:CheckBox id="checkBox"
                        selected="false" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:CheckBox id="checkBox2"
            label="CheckBox"
            selected="true"
            enabled="{checkBox.selected}" /&gt;

&lt;/mx:Application&gt;
</pre>
<p>Or, you can set the <code>disabledColor</code> style using ActionScript, as seen in the following example:</p>
<p class="download"><a href="">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2009/01/24/setting-the-disabled-text-color-on-a-checkbox-control-in-flex/ --&gt;
&lt;mx:Application name="CheckBox_disabledColor_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.events.ColorPickerEvent;

            private function colorPicker_change(evt:ColorPickerEvent):void {
                checkBox2.setStyle("disabledColor", evt.color);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="disabledColor:"&gt;
                &lt;mx:ColorPicker id="colorPicker"
                        change="colorPicker_change(event);" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="enabled:"&gt;
                &lt;mx:CheckBox id="checkBox"
                        selected="false" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:CheckBox id="checkBox2"
            label="CheckBox"
            selected="true"
            enabled="{checkBox.selected}" /&gt;

&lt;/mx:Application&gt;
</pre>
<p>Due to popular demand, here is the &#8220;same&#8221; example in a more ActionScript friendly format:</p>
<p class="download"><a href="">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2009/01/24/setting-the-disabled-text-color-on-a-checkbox-control-in-flex/ --&gt;
&lt;mx:Application name="CheckBox_disabledColor_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        preinitialize="init();"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.containers.ApplicationControlBar;
            import mx.containers.Form;
            import mx.containers.FormItem;
            import mx.controls.CheckBox;
            import mx.controls.ColorPicker;
            import mx.events.ColorPickerEvent;

            private var checkBox:CheckBox;
            private var checkBox2:CheckBox
            private var colorPicker:ColorPicker;

            private function init():void {
                colorPicker = new ColorPicker();
                colorPicker.addEventListener(ColorPickerEvent.CHANGE, colorPicker_change);

                checkBox = new CheckBox();
                checkBox.addEventListener(Event.CHANGE, checkBox_change);

                var formItem1:FormItem = new FormItem();
                formItem1.label = "disabledColor:";
                formItem1.addChild(colorPicker);

                var formItem2:FormItem = new FormItem();
                formItem2.label = "enabled:";
                formItem2.addChild(checkBox);

                var form:Form = new Form();
                form.styleName = "plain";
                form.addChild(formItem1);
                form.addChild(formItem2);

                var appControlBar:ApplicationControlBar = new ApplicationControlBar();
                appControlBar.dock = true;
                appControlBar.addChild(form);
                addChildAt(appControlBar, 0);

                checkBox2 = new CheckBox();
                checkBox2.label = "CheckBox";
                checkBox2.selected = true;
                checkBox2.enabled = false;
                addChild(checkBox2);
            }

            private function colorPicker_change(evt:ColorPickerEvent):void {
                checkBox2.setStyle("disabledColor", evt.color);
            }

            private function checkBox_change(evt:Event):void {
                checkBox2.enabled = checkBox.selected;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting the disabled text color on a CheckBox control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/01/24/setting-the-disabled-text-color-on-a-checkbox-control-in-flex/',contentID: 'post-942',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'disabledColor,enabled',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2009/01/24/setting-the-disabled-text-color-on-a-checkbox-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Displaying a hand cursor when the user rolls over the CheckBox control in Flex</title>
		<link>http://blog.flexexamples.com/2008/08/15/displaying-a-hand-cursor-when-the-user-rolls-over-the-checkbox-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/08/15/displaying-a-hand-cursor-when-the-user-rolls-over-the-checkbox-control-in-flex/#comments</comments>
		<pubDate>Fri, 15 Aug 2008 08:02:59 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[CheckBox]]></category>
		<category><![CDATA[buttonMode]]></category>
		<category><![CDATA[useHandCursor]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/15/displaying-a-hand-cursor-when-the-user-rolls-over-the-checkbox-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can display a hand cursor when the user rolls their mouse over the Flex CheckBox control by setting the useHandCursor and buttonMode properties.</p> <p>According to the documentation for the useHandCursor property:</p> <p> A Boolean value that indicates whether the pointing hand (hand cursor) appears when the mouse rolls over [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can display a hand cursor when the user rolls their mouse over the Flex CheckBox control by setting the <code>useHandCursor</code> and <code>buttonMode</code> properties.</p>
<p>According to the documentation for the <code>useHandCursor</code> property:</p>
<blockquote><p>
A Boolean value that indicates whether the pointing hand (hand cursor) appears when the mouse rolls over a sprite in which the <code>buttonMode</code> property is set to <code>true</code>. The default value of the <code>useHandCursor</code> property is <code>true</code>. If <code>useHandCursor</code> is set to <code>true</code>, the pointing hand used for buttons appears when the mouse rolls over a button sprite. If <code>useHandCursor</code> is <code>false</code>, the arrow pointer is used instead.
</p></blockquote>
<p>Full code after the jump.</p>
<p><span id="more-745"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/CheckBox_useHandCursor_test/bin/srcview/source/main.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/08/15/displaying-a-hand-cursor-when-the-user-rolls-over-the-checkbox-control-in-flex/ --&gt;
&lt;mx:Application name="CheckBox_useHandCursor_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:CheckBox id="checkBox"
            label="useHandCursor"
            useHandCursor="{checkBox.selected}"
            buttonMode="true"
            selected="true" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/CheckBox_useHandCursor_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/CheckBox_useHandCursor_test/bin/main.html" width="100%" height="100"></iframe></p>
<p>You can also set the <code>useHandCursor</code> property using ActionScript, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/CheckBox_useHandCursor_test/bin/srcview/source/main2.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/08/15/displaying-a-hand-cursor-when-the-user-rolls-over-the-checkbox-control-in-flex/ --&gt;
&lt;mx:Application name="CheckBox_useHandCursor_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            private function checkBox_change(evt:Event):void {
                checkBox.useHandCursor = checkBox.selected;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:CheckBox id="checkBox"
            label="useHandCursor"
            useHandCursor="true"
            buttonMode="true"
            selected="true"
            change="checkBox_change(event);" /&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Displaying a hand cursor when the user rolls over the CheckBox control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/08/15/displaying-a-hand-cursor-when-the-user-rolls-over-the-checkbox-control-in-flex/',contentID: 'post-745',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'buttonMode,useHandCursor',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/08/15/displaying-a-hand-cursor-when-the-user-rolls-over-the-checkbox-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Enabling sticky highlighting on a CheckBox control in Flex</title>
		<link>http://blog.flexexamples.com/2008/08/14/enabling-sticky-highlighting-on-a-checkbox-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/08/14/enabling-sticky-highlighting-on-a-checkbox-control-in-flex/#comments</comments>
		<pubDate>Fri, 15 Aug 2008 06:22:20 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[CheckBox]]></category>
		<category><![CDATA[stickyHighlighting]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/14/enabling-sticky-highlighting-on-a-checkbox-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can enable sticky highlighting on a Flex CheckBox control by setting the stickyHighlighting property.</p> <p>According to the documentation for the stickyHighlighting property:</p> <p> If false, the CheckBox displays its down skin when the user presses it but changes to its over skin when the user drags the mouse off [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can enable sticky highlighting on a Flex CheckBox control by setting the <code>stickyHighlighting</code> property.</p>
<p>According to the documentation for the <code>stickyHighlighting</code> property:</p>
<blockquote><p>
If <code>false</code>, the CheckBox displays its down skin when the user presses it but changes to its over skin when the user drags the mouse off of it. If <code>true</code>, the CheckBox displays its down skin when the user presses it, and continues to display this skin when the user drags the mouse off of it.
</p></blockquote>
<p>Full code after the jump.</p>
<p><span id="more-744"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/CheckBox_stickyHighlighting_test/bin/srcview/source/main.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/08/14/enabling-sticky-highlighting-on-a-checkbox-control-in-flex/ --&gt;
&lt;mx:Application name="CheckBox_stickyHighlighting_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:CheckBox id="checkBox"
                label="use stickyHighlighting:"
                labelPlacement="left" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:CheckBox id="checkBox2"
            label="CheckBox"
            stickyHighlighting="{checkBox.selected}" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/CheckBox_stickyHighlighting_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/CheckBox_stickyHighlighting_test/bin/main.html" width="100%" height="120"></iframe></p>
<p>You can also set the <code>stickyHighlighting</code> property using ActionScript, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/CheckBox_stickyHighlighting_test/bin/srcview/source/main2.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/08/14/enabling-sticky-highlighting-on-a-checkbox-control-in-flex/ --&gt;
&lt;mx:Application name="CheckBox_stickyHighlighting_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            private function checkBox_change(evt:Event):void {
                checkBox2.stickyHighlighting = checkBox.selected;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:CheckBox id="checkBox"
                label="use stickyHighlighting:"
                labelPlacement="left"
                change="checkBox_change(event);" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:CheckBox id="checkBox2"
            label="CheckBox" /&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Enabling sticky highlighting on a CheckBox control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/08/14/enabling-sticky-highlighting-on-a-checkbox-control-in-flex/',contentID: 'post-744',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'stickyHighlighting',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/08/14/enabling-sticky-highlighting-on-a-checkbox-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Displaying CheckBox controls using the Repeater in Flex</title>
		<link>http://blog.flexexamples.com/2008/05/29/displaying-checkbox-controls-using-the-repeater-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/05/29/displaying-checkbox-controls-using-the-repeater-in-flex/#comments</comments>
		<pubDate>Thu, 29 May 2008 13:31:53 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[CheckBox]]></category>
		<category><![CDATA[Repeater]]></category>
		<category><![CDATA[currentItem]]></category>
		<category><![CDATA[getRepeaterItem()]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/05/29/displaying-checkbox-controls-using-the-repeater-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can display a series of CheckBox controls using the Flex Repeater with an Array data provider.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Repeater_CheckBox_test/bin/srcview/source/main.mxml.html">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/05/29/displaying-checkbox-controls-using-the-repeater-in-flex/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Script&#62; &#60;![CDATA[ import mx.controls.Alert; import mx.controls.CheckBox; private function button_click(evt:Event):void { var selArr:Array [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can display a series of CheckBox controls using the Flex Repeater with an Array data provider.</p>
<p>Full code after the jump.</p>
<p><span id="more-650"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Repeater_CheckBox_test/bin/srcview/source/main.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/05/29/displaying-checkbox-controls-using-the-repeater-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.controls.Alert;
            import mx.controls.CheckBox;

            private function button_click(evt:Event):void {
                var selArr:Array = [];
                var idx:int;
                var len:int = arr.length;
                for (idx=0; idx&lt;len; idx++) {
                    if (checkBox[idx].selected) {
                        selArr.push(checkBox[idx].label);
                    }
                }

                var title:String = selArr.length + " of " + len + " item(s) selected.";
                var message:String = selArr.join("\\n");
                Alert.show(message, title);
            }

            private function doFilter(element:*, index:int, arr:Array):Boolean {
                return element.selected;
            }

            private function checkBox_change(evt:Event):void {
                var ch:CheckBox = evt.currentTarget as CheckBox;
                Alert.show(ch.getRepeaterItem().data);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Array id="arr"&gt;
        &lt;mx:Object label="Red" data="red" /&gt;
        &lt;mx:Object label="Orange" data="haloOrange" /&gt;
        &lt;mx:Object label="Yellow" data="yellow" /&gt;
        &lt;mx:Object label="Green" data="haloGreen" /&gt;
        &lt;mx:Object label="Blue" data="haloBlue" /&gt;
    &lt;/mx:Array&gt;

    &lt;mx:Panel id="panel" width="50%" paddingLeft="10" verticalGap="10"&gt;
        &lt;mx:Repeater id="checkBoxRepeater" dataProvider="{arr}"&gt;
            &lt;mx:CheckBox id="checkBox"
                    label="{checkBoxRepeater.currentItem.label}"
                    data="{checkBoxRepeater.currentItem.data}"
                    change="checkBox_change(event);" /&gt;
        &lt;/mx:Repeater&gt;
        &lt;mx:ControlBar horizontalAlign="right"&gt;
            &lt;mx:Button id="button"
                    label="Click me"
                    emphasized="true"
                    click="button_click(event);" /&gt;
        &lt;/mx:ControlBar&gt;
    &lt;/mx:Panel&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Repeater_CheckBox_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/Repeater_CheckBox_test/bin/main.html" width="100%" height="300"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Displaying CheckBox controls using the Repeater in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/05/29/displaying-checkbox-controls-using-the-repeater-in-flex/',contentID: 'post-650',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'currentItem,getRepeaterItem()',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/05/29/displaying-checkbox-controls-using-the-repeater-in-flex/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Setting an error string on a CheckBox control in Flex</title>
		<link>http://blog.flexexamples.com/2008/05/21/setting-an-error-string-on-a-checkbox-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/05/21/setting-an-error-string-on-a-checkbox-control-in-flex/#comments</comments>
		<pubDate>Thu, 22 May 2008 06:17:02 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[CheckBox]]></category>
		<category><![CDATA[errorString]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/05/21/setting-an-error-string-on-a-checkbox-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can set an error string on a Flex CheckBox control by setting the errorString property.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/CheckBox_errorString_test/bin/srcview/source/main.mxml.html">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/05/21/setting-an-error-string-on-a-checkbox-control-in-flex/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Script&#62; &#60;![CDATA[ private function checkBox_change(evt:Event):void { if (checkBox.selected) { checkBox.errorString = ""; } [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set an error string on a Flex CheckBox control by setting the <code>errorString</code> property.</p>
<p>Full code after the jump.</p>
<p><span id="more-638"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/CheckBox_errorString_test/bin/srcview/source/main.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/05/21/setting-an-error-string-on-a-checkbox-control-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            private function checkBox_change(evt:Event):void {
                if (checkBox.selected) {
                    checkBox.errorString = "";
                } else {
                    checkBox.errorString = "You must click here to continue";
                }
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Panel width="100%" height="100%"&gt;
        &lt;mx:TextArea id="textArea"
                condenseWhite="true"
                editable="false"
                textAlign="justify"
                width="100%"
                height="100%"&gt;
            &lt;mx:htmlText&gt;
                &lt;![CDATA[
                    &lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quisque vitae massa. Curabitur sed dolor. Maecenas risus lacus, pretium eget, tempor vestibulum, mattis vitae, sem. Pellentesque ligula nisi, sagittis sit amet, tincidunt vitae, volutpat non, arcu. Mauris non arcu. In molestie nunc. Nam molestie dui lacinia massa commodo vehicula. Ut sed ante sit amet tellus aliquam rhoncus. Nunc orci urna, dictum eget, faucibus vitae, tempus vel, dui. Vestibulum quis arcu. Morbi felis justo, hendrerit quis, tempus ac, elementum sit amet, quam. Proin congue, leo eget aliquet rhoncus, tellus lectus varius ipsum, ac ultrices erat ligula non justo. Nunc porttitor diam vel dolor luctus semper. Ut non eros volutpat mi condimentum ornare. Praesent quis nunc et libero pulvinar pretium. Sed leo lorem, fringilla vel, sodales ac, suscipit ut, nunc. Vestibulum faucibus elit. Vivamus pharetra libero ut arcu. Curabitur sit amet tellus.&lt;/p&gt;
                    &lt;p&gt;Fusce sagittis. Suspendisse potenti. Aliquam velit sapien, porta at, cursus sed, pellentesque sit amet, libero. Duis aliquet purus eget mauris. Curabitur a ipsum. Nulla facilisi. Etiam porta, odio quis semper cursus, est ante volutpat massa, quis blandit orci dui ut nibh. Nulla sodales leo sit amet ligula. Suspendisse ultrices. Proin vitae felis.&lt;/p&gt;
                    &lt;p&gt;Maecenas pellentesque, ligula blandit venenatis semper, magna quam laoreet urna, ut iaculis urna urna eu tortor. In interdum, dolor ut lobortis congue, massa velit egestas lectus, sed commodo sapien risus et ante. Proin id erat ac nibh luctus aliquet. Vestibulum sagittis turpis non est. Suspendisse ipsum ligula, suscipit vel, feugiat eu, commodo non, risus. Integer suscipit sapien quis lectus. Aliquam dictum, magna quis pellentesque aliquet, felis pede porttitor quam, at luctus risus odio eu ante. Phasellus a purus. Ut id dui nec diam congue auctor. Nullam nec pede. Vivamus ullamcorper iaculis urna.&lt;/p&gt;
                    &lt;p&gt;Ut ultrices. Praesent convallis massa sit amet ipsum. Aenean varius posuere erat. Sed vulputate, purus eu consectetuer molestie, risus dui egestas augue, sed cursus sapien orci a turpis. Cras erat metus, ullamcorper quis, sollicitudin quis, suscipit vitae, ipsum. Suspendisse metus dolor, aliquet sit amet, vulputate sit amet, euismod ac, tortor. Nulla facilisi. Vestibulum ac sem at arcu blandit pretium. Sed faucibus, dolor sit amet viverra aliquet, mi arcu sollicitudin ante, at consequat risus mauris sit amet ante. Phasellus mi tellus, blandit ac, tempor a, pulvinar vel, ligula. Pellentesque molestie est sed nulla. Nam vel quam at magna pulvinar gravida. Curabitur sed neque eget enim tempor volutpat. Praesent varius. Nulla varius pulvinar nunc. Nulla interdum eros sed quam.&lt;/p&gt;
                    &lt;p&gt;Aliquam erat volutpat. Aliquam vestibulum. Mauris fringilla, enim vitae viverra aliquet, nunc purus pretium massa, congue viverra lectus lacus in est. Sed posuere augue a tellus. Ut nunc leo, luctus ut, consequat scelerisque, ornare eu, metus. Duis et purus. Nunc hendrerit nunc. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Integer vel neque. Proin mi. Aliquam sollicitudin, nulla et tincidunt luctus, orci magna eleifend velit, placerat tempor ipsum sem vitae tortor. Etiam ac urna placerat erat pulvinar venenatis. Phasellus convallis diam in metus. Donec dui risus, sollicitudin vel, pulvinar sit amet, luctus sed, massa. Quisque ultrices lacus vel eros.&lt;/p&gt;
                ]]&gt;
            &lt;/mx:htmlText&gt;
        &lt;/mx:TextArea&gt;
        &lt;mx:ControlBar&gt;
            &lt;mx:CheckBox id="checkBox"
                    label="I have read and agreed to your license"
                    errorString="You must click here to continue"
                    change="checkBox_change(event);"
                    width="100%" /&gt;
            &lt;mx:Button label="Next &gt;&gt;"
                    enabled="{checkBox.selected}" /&gt;
        &lt;/mx:ControlBar&gt;
    &lt;/mx:Panel&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/CheckBox_errorString_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/CheckBox_errorString_test/bin/main.html" width="100%" height="300"></iframe></p>
<p>For some similar examples, see <a href="http://blog.flexexamples.com/2007/09/13/checking-to-see-if-a-flex-checkbox-is-selected-before-allowing-a-user-to-press-a-button/">&#8220;Checking to see if a Flex CheckBox is selected before allowing a user to press a Button&#8221;</a>.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting an error string on a CheckBox control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/05/21/setting-an-error-string-on-a-checkbox-control-in-flex/',contentID: 'post-638',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'errorString',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/05/21/setting-an-error-string-on-a-checkbox-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Truncating the label on a Flex CheckBox control</title>
		<link>http://blog.flexexamples.com/2008/02/06/truncating-the-label-on-a-flex-checkbox-control/</link>
		<comments>http://blog.flexexamples.com/2008/02/06/truncating-the-label-on-a-flex-checkbox-control/#comments</comments>
		<pubDate>Thu, 07 Feb 2008 03:07:00 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[CheckBox]]></category>
		<category><![CDATA[Label]]></category>
		<category><![CDATA[width]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/02/06/truncating-the-label-on-a-flex-checkbox-control/</guid>
		<description><![CDATA[<p>The following example shows how you can truncate the label on a CheckBox control in Flex by setting the width property.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/CheckBox_width_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/02/06/truncating-the-label-on-a-flex-checkbox-control/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:String id="str"&#62;The quick brown fox jumped over the lazy dog.&#60;/mx:String&#62; &#60;mx:Form&#62; &#60;mx:FormItem label="default:"&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can truncate the label on a CheckBox control in Flex by setting the <code>width</code> property.</p>
<p>Full code after the jump.</p>
<p><span id="more-488"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/CheckBox_width_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/02/06/truncating-the-label-on-a-flex-checkbox-control/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:String id="str"&gt;The quick brown fox jumped over the lazy dog.&lt;/mx:String&gt;

    &lt;mx:Form&gt;
        &lt;mx:FormItem label="default:"&gt;
            &lt;mx:CheckBox id="checkBox1"
                    label="{str}" /&gt;
        &lt;/mx:FormItem&gt;
        &lt;mx:FormItem label="width = 200:"&gt;
            &lt;mx:CheckBox id="checkBox2"
                    label="{str}"
                    width="200" /&gt;
        &lt;/mx:FormItem&gt;
    &lt;/mx:Form&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/CheckBox_width_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/CheckBox_width_test/bin/main.html" width="100%" height="150"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Truncating the label on a Flex CheckBox control on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/02/06/truncating-the-label-on-a-flex-checkbox-control/',contentID: 'post-488',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'width',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/02/06/truncating-the-label-on-a-flex-checkbox-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using a CheckBox control as a list item renderer in Flex</title>
		<link>http://blog.flexexamples.com/2008/01/27/using-a-checkbox-control-as-a-list-item-renderer-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/01/27/using-a-checkbox-control-as-a-list-item-renderer-in-flex/#comments</comments>
		<pubDate>Sun, 27 Jan 2008 18:29:43 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[ArrayCollection]]></category>
		<category><![CDATA[CheckBox]]></category>
		<category><![CDATA[Component]]></category>
		<category><![CDATA[List]]></category>
		<category><![CDATA[collectionChange]]></category>
		<category><![CDATA[filter()]]></category>
		<category><![CDATA[itemRenderer]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/27/using-a-checkbox-control-as-a-list-item-renderer-in-flex/</guid>
		<description><![CDATA[<p>The following example will show you how you can use a CheckBox control as a custom item renderer in a List control in Flex.<br /> I haven&#8217;t done a lot of testing yet, so if you have any tips/suggestions/improvements, please, share them in the comments.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/List_itemRenderer_test_2/main.mxml">View MXML</a></p> [...]]]></description>
			<content:encoded><![CDATA[<p>The following example will show you how you can use a CheckBox control as a custom item renderer in a List control in Flex.<br />
I haven&#8217;t done a lot of testing yet, so if you have any tips/suggestions/improvements, please, share them in the comments.</p>
<p>Full code after the jump.</p>
<p><span id="more-487"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/List_itemRenderer_test_2/main.mxml">View MXML</a></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: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2008/01/27/using-a-checkbox-control-as-a-list-item-renderer-in-flex/ --&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>
<span style="color: #000000;">        xmlns:vo=<span style="color: #ff0000;">&quot;*&quot;</span></span>
<span style="color: #000000;">        layout=<span style="color: #ff0000;">&quot;horizontal&quot;</span></span>
<span style="color: #000000;">        verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span></span>
<span style="color: #000000;">        backgroundColor=<span style="color: #ff0000;">&quot;white&quot;</span></span>
<span style="color: #000000;">        creationComplete=<span style="color: #ff0000;">&quot;init();&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;">            import mx.events.CollectionEvent;</span>
<span style="color: #339933;">            import mx.utils.ObjectUtil;</span>
&nbsp;
<span style="color: #339933;">            private function init():void {</span>
<span style="color: #339933;">                arrColl.dispatchEvent(new CollectionEvent(CollectionEvent.COLLECTION_CHANGE));</span>
<span style="color: #339933;">            }</span>
&nbsp;
<span style="color: #339933;">            private function arrColl_collectionChange(evt:CollectionEvent):void {</span>
<span style="color: #339933;">                try {</span>
<span style="color: #339933;">                    var tArr:Array = arrColl.source.filter(selectedOnly);</span>
<span style="color: #339933;">                    textArea.text = ObjectUtil.toString(tArr);</span>
<span style="color: #339933;">                    lbl.text = tArr.length.toString() + &quot; item(s) selected&quot;;</span>
<span style="color: #339933;">                } catch (err:Error) {</span>
<span style="color: #339933;">                    // ignore.</span>
<span style="color: #339933;">                }</span>
<span style="color: #339933;">            }</span>
&nbsp;
<span style="color: #339933;">            private function selectedOnly(item:ListItemValueObject, idx:uint, arr:Array):Boolean {</span>
<span style="color: #339933;">                return item.isSelected;</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:Array</span> id=<span style="color: #ff0000;">&quot;arr&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;vo:ListItemValueObject</span> label=<span style="color: #ff0000;">&quot;One&quot;</span> isSelected=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;vo:ListItemValueObject</span> label=<span style="color: #ff0000;">&quot;Two&quot;</span> isSelected=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;vo:ListItemValueObject</span> label=<span style="color: #ff0000;">&quot;Three&quot;</span> isSelected=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;vo:ListItemValueObject</span> label=<span style="color: #ff0000;">&quot;Four&quot;</span> isSelected=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;vo:ListItemValueObject</span> label=<span style="color: #ff0000;">&quot;Five&quot;</span> isSelected=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;vo:ListItemValueObject</span> label=<span style="color: #ff0000;">&quot;Six&quot;</span> isSelected=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;vo:ListItemValueObject</span> label=<span style="color: #ff0000;">&quot;Seven&quot;</span> isSelected=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;vo:ListItemValueObject</span> label=<span style="color: #ff0000;">&quot;Eight&quot;</span> isSelected=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;vo:ListItemValueObject</span> label=<span style="color: #ff0000;">&quot;Nine&quot;</span> isSelected=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;vo:ListItemValueObject</span> label=<span style="color: #ff0000;">&quot;Ten&quot;</span> isSelected=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;vo:ListItemValueObject</span> label=<span style="color: #ff0000;">&quot;Eleven&quot;</span> isSelected=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;vo:ListItemValueObject</span> label=<span style="color: #ff0000;">&quot;Twelve&quot;</span> isSelected=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Array</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ArrayCollection</span> id=<span style="color: #ff0000;">&quot;arrColl&quot;</span></span>
<span style="color: #000000;">            source=<span style="color: #ff0000;">&quot;{arr}&quot;</span></span>
<span style="color: #000000;">            collectionChange=<span style="color: #ff0000;">&quot;arrColl_collectionChange(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Panel</span> id=<span style="color: #ff0000;">&quot;panel&quot;</span></span>
<span style="color: #000000;">            title=<span style="color: #ff0000;">&quot;Items&quot;</span></span>
<span style="color: #000000;">            status=<span style="color: #ff0000;">&quot;{arrColl.length} total&quot;</span></span>
<span style="color: #000000;">            styleName=<span style="color: #ff0000;">&quot;opaquePanel&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:List</span> id=<span style="color: #ff0000;">&quot;list&quot;</span></span>
<span style="color: #000000;">                dataProvider=<span style="color: #ff0000;">&quot;{arrColl}&quot;</span></span>
<span style="color: #000000;">                alternatingItemColors=<span style="color: #ff0000;">&quot;[#EEEEEE, white]&quot;</span></span>
<span style="color: #000000;">                width=<span style="color: #ff0000;">&quot;150&quot;</span></span>
<span style="color: #000000;">                rowCount=<span style="color: #ff0000;">&quot;8&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:itemRenderer</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Component</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:CheckBox</span> selectedField=<span style="color: #ff0000;">&quot;isSelected&quot;</span></span>
<span style="color: #000000;">                            change=<span style="color: #ff0000;">&quot;onChange(event);&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #339933;">&lt;mx:Script&gt;</span>
<span style="color: #339933;">                            &lt;![CDATA[</span>
<span style="color: #339933;">                                private function onChange(evt:Event):void {</span>
<span style="color: #339933;">                                    data.isSelected = !data.isSelected;</span>
<span style="color: #339933;">                                }</span>
<span style="color: #339933;">                            ]]&gt;</span>
<span style="color: #339933;">                        &lt;/mx:Script&gt;</span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:CheckBox</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Component</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:itemRenderer</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:List</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ControlBar</span> horizontalAlign=<span style="color: #ff0000;">&quot;right&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Label</span> id=<span style="color: #ff0000;">&quot;lbl&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ControlBar</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Panel</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:TextArea</span> id=<span style="color: #ff0000;">&quot;textArea&quot;</span></span>
<span style="color: #000000;">            verticalScrollPolicy=<span style="color: #ff0000;">&quot;on&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;100%&quot;</span></span>
<span style="color: #000000;">            height=<span style="color: #ff0000;">&quot;{panel.height}&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 class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/List_itemRenderer_test_2/ListItemValueObject.as">View ListItemValueObject.as</a></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #3f5fbf;">/**
 * http://blog.flexexamples.com/2008/01/27/using-a-checkbox-control-as-a-list-item-renderer-in-flex/
 */</span>
<span style="color: #9900cc; font-weight: bold;">package</span> <span style="color: #000000;">&#123;</span>
    <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> ListItemValueObject <span style="color: #000000;">&#123;</span>
&nbsp;
        <span style="color: #000000;">&#91;</span>Bindable<span style="color: #000000;">&#93;</span>
        <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> label<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
        <span style="color: #000000;">&#91;</span>Bindable<span style="color: #000000;">&#93;</span>
        <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> isSelected<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
        <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> ListItemValueObject<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
            <span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/List_itemRenderer_test_2/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/List_itemRenderer_test_2/bin/main.html" width="100%" height="350"></iframe></p>
<p class="construction">For lots more information on item renderers from somebody who knows what he&#8217;s talking about, check out Alex Harui&#8217;s excellent item renderer articles: <a href="http://blogs.adobe.com/aharui/2007/03/thinking_about_item_renderers_1.html">&#8220;Thinking About Item Renderers&#8221;</a> and <a href="http://blogs.adobe.com/aharui/2007/04/more_thinking_about_item_rende.html">&#8220;More Thinking About Item Renderers&#8221;</a>.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Using a CheckBox control as a list item renderer in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/01/27/using-a-checkbox-control-as-a-list-item-renderer-in-flex/',contentID: 'post-487',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'collectionChange,filter(),itemRenderer',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/01/27/using-a-checkbox-control-as-a-list-item-renderer-in-flex/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
		<item>
		<title>Adding your own custom CheckBox control icons in Flex</title>
		<link>http://blog.flexexamples.com/2007/09/29/adding-your-own-custom-checkbox-control-icons-in-flex/</link>
		<comments>http://blog.flexexamples.com/2007/09/29/adding-your-own-custom-checkbox-control-icons-in-flex/#comments</comments>
		<pubDate>Sun, 30 Sep 2007 03:53:23 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[CheckBox]]></category>
		<category><![CDATA[downIcon]]></category>
		<category><![CDATA[icon]]></category>
		<category><![CDATA[overIcon]]></category>
		<category><![CDATA[selectedDownIcon]]></category>
		<category><![CDATA[selectedOverIcon]]></category>
		<category><![CDATA[selectedUpIcon]]></category>
		<category><![CDATA[upIcon]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/09/29/adding-your-own-custom-checkbox-control-icons-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can override the default icon in the Adobe Flex CheckBox control and replace it with a custom embedded graphic.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/CheckBox_icon_test_2/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2007/09/29/adding-your-own-custom-checkbox-control-icons-in-flex/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Style&#62; CheckBox { /* Unselected icons */ upIcon: Embed(source="assets/bullet_red.png"); [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can override the default icon in the Adobe Flex CheckBox control and replace it with a custom embedded graphic.</p>
<p>Full code after the jump.</p>
<p><span id="more-215"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/CheckBox_icon_test_2/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2007/09/29/adding-your-own-custom-checkbox-control-icons-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        CheckBox {
            /* Unselected icons */
            upIcon: Embed(source="assets/bullet_red.png");
            overIcon: Embed(source="assets/bullet_red.png");
            downIcon: Embed(source="assets/bullet_yellow.png");
            /* Selected icons */
            selectedUpIcon: Embed(source="assets/bullet_green.png");
            selectedOverIcon: Embed(source="assets/bullet_green.png");
            selectedDownIcon: Embed(source="assets/bullet_yellow.png");
        }
    &lt;/mx:Style&gt;

    &lt;mx:CheckBox id="cheezburger"
            label="I can has cheezburger?"
            fontSize="12"
            fontWeight="bold" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/CheckBox_icon_test_2/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/CheckBox_icon_test_2/bin/main.html" width="100%" height="200"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Adding your own custom CheckBox control icons in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/09/29/adding-your-own-custom-checkbox-control-icons-in-flex/',contentID: 'post-215',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'downIcon,icon,overIcon,selectedDownIcon,selectedOverIcon,selectedUpIcon,upIcon',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2007/09/29/adding-your-own-custom-checkbox-control-icons-in-flex/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

