<?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; numRadioButtonsChanged</title>
	<atom:link href="http://blog.flexexamples.com/tag/numradiobuttonschanged/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>Detecting when the number of radio buttons changes in a radio button group in Flex</title>
		<link>http://blog.flexexamples.com/2008/11/10/detecting-when-the-number-of-radio-buttons-changes-in-a-radio-button-group-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/11/10/detecting-when-the-number-of-radio-buttons-changes-in-a-radio-button-group-in-flex/#comments</comments>
		<pubDate>Tue, 11 Nov 2008 03:56:55 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[RadioButton]]></category>
		<category><![CDATA[RadioButtonGroup]]></category>
		<category><![CDATA[numRadioButtonsChanged]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/11/10/detecting-when-the-number-of-radio-buttons-changes-in-a-radio-button-group-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can detect when the number of RadioButton objects changes in a RadioButtonGroup in Flex by listening for the numRadioButtonsChanged event.</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/2008/11/10/detecting-when-the-number-of-radio-buttons-changes-in-a-radio-button-group-in-flex/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white" initialize="init();"&#62; &#60;mx:Script&#62; &#60;![CDATA[ import mx.controls.Alert; private function init():void [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can detect when the number of RadioButton objects changes in a RadioButtonGroup in Flex by listening for the <code>numRadioButtonsChanged</code> event.</p>
<p>Full code after the jump.</p>
<p><span id="more-679"></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/2008/11/10/detecting-when-the-number-of-radio-buttons-changes-in-a-radio-button-group-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        initialize="init();"&gt;

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

            private function init():void {
                radioGroup.addEventListener("numRadioButtonsChanged", radioGroup_numRadioButtonsChanged);
            }

            private function radioGroup_numRadioButtonsChanged(evt:Event):void {
                var rb:RadioButton = radioGroup.getRadioButtonAt(radioGroup.numRadioButtons-1);
                var alert:Alert = Alert.show(evt.toString(), "label:" + rb.label);
                alert.status = "numRadioButtons:" + radioGroup.numRadioButtons;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:RadioButtonGroup id="radioGroup" /&gt;

    &lt;mx:HBox&gt;
        &lt;mx:RadioButton id="radioButton1" label="Red" group="{radioGroup}" /&gt;
        &lt;mx:RadioButton id="radioButton2" label="Orange" group="{radioGroup}" /&gt;
        &lt;mx:RadioButton id="radioButton3" label="Yellow" group="{radioGroup}" /&gt;
        &lt;mx:RadioButton id="radioButton4" label="Green" group="{radioGroup}" /&gt;
        &lt;mx:RadioButton id="radioButton5" label="Blue" group="{radioGroup}" /&gt;
    &lt;/mx:HBox&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Detecting when the number of radio buttons changes in a radio button group in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/11/10/detecting-when-the-number-of-radio-buttons-changes-in-a-radio-button-group-in-flex/',contentID: 'post-679',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'numRadioButtonsChanged',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/11/10/detecting-when-the-number-of-radio-buttons-changes-in-a-radio-button-group-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

