<?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; getHeaderAt()</title>
	<atom:link href="http://blog.flexexamples.com/tag/getheaderat/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>Adding icons to a Flex Accordion control (redux)</title>
		<link>http://blog.flexexamples.com/2008/10/16/adding-icons-to-a-flex-accordion-control-redux/</link>
		<comments>http://blog.flexexamples.com/2008/10/16/adding-icons-to-a-flex-accordion-control-redux/#comments</comments>
		<pubDate>Fri, 17 Oct 2008 06:57:12 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Accordion]]></category>
		<category><![CDATA[getHeaderAt()]]></category>
		<category><![CDATA[selectedDownIcon]]></category>
		<category><![CDATA[selectedOverIcon]]></category>
		<category><![CDATA[selectedUpIcon]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/10/16/adding-icons-to-a-flex-accordion-control-redux/</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2007/08/27/adding-icons-to-a-flex-accordion-control/">&#8220;Adding icons to a Flex Accordion control&#8221;</a>, we saw how you could add embedded icons to a Flex Accordion container by setting the icon style.</p> <p>The following example shows how you can set a separate icon on an Accordion header when the header is selected by looping over each header [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2007/08/27/adding-icons-to-a-flex-accordion-control/">&#8220;Adding icons to a Flex Accordion control&#8221;</a>, we saw how you could add embedded icons to a Flex Accordion container by setting the <code>icon</code> style.</p>
<p>The following example shows how you can set a separate icon on an Accordion header when the header is selected by looping over each header using the <code>getHeaderAt()</code> method and setting the <code>selectedUpIcon</code>, <code>selectedOverIcon</code>, and <code>selectedDownIcon</code> styles.</p>
<p>Full code after the jump.</p>
<p><span id="more-833"></span></p>
<p class="download"><a href="">View MXML</a></p>
<pre class="code">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;!-- http://blog.flexexamples.com/2008/10/16/adding-icons-to-a-flex-accordion-control-redux/ --&gt;
&lt;mx:Application name=&quot;Accordion_getHeaderAt_selectedUpIcon_test&quot;
        xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;
        layout=&quot;vertical&quot;
        verticalAlign=&quot;middle&quot;
        backgroundColor=&quot;white&quot;&gt;

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

            [Embed(&quot;assets/bullet_red.png&quot;)]
            private const RedIcon:Class;

            [Embed(&quot;assets/bullet_orange.png&quot;)]
            private const OrangeIcon:Class;

            [Embed(&quot;assets/bullet_yellow.png&quot;)]
            private const YellowIcon:Class;

            [Embed(&quot;assets/bullet_green.png&quot;)]
            private const GreenIcon:Class;

            [Embed(&quot;assets/bullet_blue.png&quot;)]
            private const BlueIcon:Class;

            [Embed(&quot;assets/bullet_star.png&quot;)]
            private const StarIcon:Class;

            private function init():void {
                var idx:uint;
                var len:uint = accordion.numChildren;
                var btn:Button;
                for (idx=0; idx&lt;len; idx++) {
                    btn = accordion.getHeaderAt(idx);
                    btn.useHandCursor = true;
                    btn.buttonMode = true;
                    btn.setStyle(&quot;selectedUpIcon&quot;, StarIcon);
                    btn.setStyle(&quot;selectedOverIcon&quot;, StarIcon);
                    btn.setStyle(&quot;selectedDownIcon&quot;, StarIcon);
                }
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Accordion id=&quot;accordion&quot;
            openDuration=&quot;0&quot;
            width=&quot;100%&quot;
            height=&quot;100%&quot;
            creationComplete=&quot;init();&quot;&gt;
        &lt;mx:VBox id=&quot;redVbox&quot;
                label=&quot;Red&quot;
                icon=&quot;{RedIcon}&quot; /&gt;
        &lt;mx:VBox id=&quot;orangeVbox&quot;
                label=&quot;Orange&quot;
                icon=&quot;{OrangeIcon}&quot; /&gt;
        &lt;mx:VBox id=&quot;yellowVbox&quot;
                label=&quot;Yellow&quot;
                icon=&quot;{YellowIcon}&quot; /&gt;
        &lt;mx:VBox id=&quot;greenVbox&quot;
                label=&quot;Green&quot;
                icon=&quot;{GreenIcon}&quot; /&gt;
        &lt;mx:VBox id=&quot;blueVbox&quot;
                label=&quot;Blue&quot;
                icon=&quot;{BlueIcon}&quot; /&gt;
    &lt;/mx:Accordion&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Adding icons to a Flex Accordion control (redux) on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/10/16/adding-icons-to-a-flex-accordion-control-redux/',contentID: 'post-833',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'getHeaderAt(),selectedDownIcon,selectedOverIcon,selectedUpIcon',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/10/16/adding-icons-to-a-flex-accordion-control-redux/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Setting styles on individual Flex Accordion headers</title>
		<link>http://blog.flexexamples.com/2007/10/30/setting-styles-on-individual-flex-accordion-headers/</link>
		<comments>http://blog.flexexamples.com/2007/10/30/setting-styles-on-individual-flex-accordion-headers/#comments</comments>
		<pubDate>Wed, 31 Oct 2007 06:38:34 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Accordion]]></category>
		<category><![CDATA[getHeaderAt()]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/10/30/setting-styles-on-individual-flex-accordion-headers/</guid>
		<description><![CDATA[<p>Loyal reader, Madhu, <a href="http://blog.flexexamples.com/2007/10/26/customizing-the-accordion-header-in-flex-3/#comment-3733">asked the following question</a> the other day:</p> <p>Is it possible to color individual headers of the accordion?</p> <p>Well, I played around with it briefly this evening and it seems that you can get individual accordion headings using the Accordion class&#8217;s getHeaderAt() method, then it is just a matter of saving that [...]]]></description>
			<content:encoded><![CDATA[<p>Loyal reader, Madhu, <a href="http://blog.flexexamples.com/2007/10/26/customizing-the-accordion-header-in-flex-3/#comment-3733">asked the following question</a> the other day:</p>
<blockquote><p>Is it possible to color individual headers of the accordion?</p></blockquote>
<p>Well, I played around with it briefly this evening and it seems that you can get individual accordion headings using the Accordion class&#8217;s <code>getHeaderAt()</code> method, then it is just a matter of saving that reference in a variable, or applying a style directly to the returned Button reference.</p>
<p>The example itself is pretty simple, but I&#8217;m sure the same principles apply to other styles as well.</p>
<p>Full code after the jump.</p>
<p><span id="more-261"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Accordion_getHeaderAt_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2007/10/30/setting-styles-on-individual-flex-accordion-headers/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        AccordionHeader {
            fillColors: black, black;
            fillAlphas: 1, 1;
            textRollOverColor: white;
            textSelectedColor: white;
            themeColor: black;
        }
    &lt;/mx:Style&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            private function init():void {
                accordion.getHeaderAt(0).setStyle("color", "red");
                accordion.getHeaderAt(1).setStyle("color", "haloOrange");
                accordion.getHeaderAt(2).setStyle("color", "yellow");
                accordion.getHeaderAt(3).setStyle("color", "haloGreen");
                accordion.getHeaderAt(4).setStyle("color", "haloBlue");
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Accordion id="accordion"
            width="300"
            height="200"
            creationComplete="init();"&gt;
        &lt;mx:VBox label="Red" /&gt;
        &lt;mx:VBox label="Orange" /&gt;
        &lt;mx:VBox label="Yellow" /&gt;
        &lt;mx:VBox label="Green" /&gt;
        &lt;mx:VBox label="Blue" /&gt;
    &lt;/mx:Accordion&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Accordion_getHeaderAt_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/Accordion_getHeaderAt_test/bin/main.html" width="100%" height="300"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting styles on individual Flex Accordion headers on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/10/30/setting-styles-on-individual-flex-accordion-headers/',contentID: 'post-261',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'getHeaderAt()',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/10/30/setting-styles-on-individual-flex-accordion-headers/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Adding icons to a Flex Accordion control</title>
		<link>http://blog.flexexamples.com/2007/08/27/adding-icons-to-a-flex-accordion-control/</link>
		<comments>http://blog.flexexamples.com/2007/08/27/adding-icons-to-a-flex-accordion-control/#comments</comments>
		<pubDate>Tue, 28 Aug 2007 03:19:19 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Accordion]]></category>
		<category><![CDATA[getHeaderAt()]]></category>
		<category><![CDATA[icon]]></category>
		<category><![CDATA[selectedIndex]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/08/27/adding-icons-to-a-flex-accordion-control/</guid>
		<description><![CDATA[<p>The following example demonstrates how you can add embedded icons to a Flex Accordion container.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Accordion_icon_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2007/08/27/adding-icons-to-a-flex-accordion-control/ --&#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[ [Bindable] [Embed(source="assets/bulletCheck.png")] private var BulletCheck:Class; [Bindable] [Embed(source="assets/bulletWarning.png")] private var BulletWarning:Class; [Bindable] [Embed(source="assets/bulletCritical.png")] private var BulletCritical:Class; ]]&#62; &#60;/mx:Script&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example demonstrates how you can add embedded icons to a Flex Accordion container.</p>
<p>Full code after the jump.</p>
<p><span id="more-121"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Accordion_icon_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2007/08/27/adding-icons-to-a-flex-accordion-control/ --&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[
            [Bindable]
            [Embed(source="assets/bulletCheck.png")]
            private var BulletCheck:Class;

            [Bindable]
            [Embed(source="assets/bulletWarning.png")]
            private var BulletWarning:Class;

            [Bindable]
            [Embed(source="assets/bulletCritical.png")]
            private var BulletCritical:Class;
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:XML id="itemsXML"&gt;
        &lt;items&gt;
            &lt;item label="Item 1" status="warning" /&gt;
            &lt;item label="Item 2" status="critical" /&gt;
            &lt;item label="Item 3" status="critical" /&gt;
            &lt;item label="Item 4" status="check" /&gt;
            &lt;item label="Item 5" status="warning" /&gt;
            &lt;item label="Item 6" status="check" /&gt;
            &lt;item label="Item 7" status="check" /&gt;
            &lt;item label="Item 8" status="critical" /&gt;
        &lt;/items&gt;
    &lt;/mx:XML&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Label text="selectedIndex: {accordion.selectedIndex}" /&gt;
        &lt;mx:Spacer width="100" /&gt;
        &lt;mx:Label text="label: {accordion.getHeaderAt(accordion.selectedIndex).label}" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:Accordion id="accordion"
            width="400"
            height="200"&gt;
        &lt;mx:VBox label="Success"
                icon="{BulletCheck}"
                width="100%"
                height="100%"&gt;
            &lt;mx:DataGrid id="successGrid"
                    dataProvider="{itemsXML.item.(@status == 'check')}"
                    width="100%"
                    height="100%"&gt;
            &lt;/mx:DataGrid&gt;
        &lt;/mx:VBox&gt;

        &lt;mx:VBox label="Warning"
                icon="{BulletWarning}"
                width="100%"
                height="100%"&gt;
            &lt;mx:DataGrid id="warningGrid"
                    dataProvider="{itemsXML.item.(@status == 'warning')}"
                    width="100%"
                    height="100%"&gt;
            &lt;/mx:DataGrid&gt;
        &lt;/mx:VBox&gt;

        &lt;mx:VBox label="Critical"
                icon="{BulletCritical}"
                width="100%"
                height="100%"&gt;
            &lt;mx:DataGrid id="criticalGrid"
                    dataProvider="{itemsXML.item.(@status == 'critical')}"
                    width="100%"
                    height="100%"&gt;
            &lt;/mx:DataGrid&gt;
        &lt;/mx:VBox&gt;
    &lt;/mx:Accordion&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Accordion_icon_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/Accordion_icon_test/bin/main.html" width="100%" height="300"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Adding icons to a Flex Accordion control on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/08/27/adding-icons-to-a-flex-accordion-control/',contentID: 'post-121',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'getHeaderAt(),icon,selectedIndex',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/08/27/adding-icons-to-a-flex-accordion-control/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

