<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Creating a custom Halo Accordion header skin in Flex 4</title>
	<atom:link href="http://blog.flexexamples.com/2009/06/21/creating-a-custom-halo-accordion-header-skin-in-flex-4/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com/2009/06/21/creating-a-custom-halo-accordion-header-skin-in-flex-4/</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Thu, 18 Mar 2010 20:18:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Peter deHaan</title>
		<link>http://blog.flexexamples.com/2009/06/21/creating-a-custom-halo-accordion-header-skin-in-flex-4/comment-page-1/#comment-6471</link>
		<dc:creator>Peter deHaan</dc:creator>
		<pubDate>Thu, 26 Nov 2009 20:05:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2009/06/21/creating-a-custom-halo-accordion-header-skin-in-flex-4/#comment-6471</guid>
		<description>@AlCapone,

Sure, I&#039;d just create an ActionScript function which sets the &lt;code&gt; headerStyleName&lt;/code&gt; style to whatever whichever custom style you want. Basically make 2-3+ custom selectors and specify the custom Accordion header skin you want to use:
&lt;pre lang=&quot;css&quot;&gt;
.customAccordionHeadStyles1 {
    skin: ClassReference(&quot;skins.CustomAccordionHeaderSkin1&quot;);
}
.customAccordionHeadStyles2 {
    skin: ClassReference(&quot;skins.CustomAccordionHeaderSkin2&quot;);
}
.customAccordionHeadStyles3 {
    skin: ClassReference(&quot;skins.CustomAccordionHeaderSkin3&quot;);
}
&lt;/pre&gt;

And then create some ActionScript functions to set the &lt;code&gt;headerStyleName&lt;/code&gt; to whichever CSS selector you want:
&lt;pre lang=&quot;actionscript3&quot;&gt;
private function useSkin1():void {
    accordion.setStyle(&quot;headerStyleName&quot;, &quot;customAccordionHeadStyles1&quot;);
}
private function useSkin2():void {
    accordion.setStyle(&quot;headerStyleName&quot;, &quot;customAccordionHeadStyles2&quot;);
}
private function useSkin3():void {
    accordion.setStyle(&quot;headerStyleName&quot;, &quot;customAccordionHeadStyles3&quot;);
}
&lt;/pre&gt;

You could probably clean up that code significantly, but it may help get you started.

Peter</description>
		<content:encoded><![CDATA[<p>@AlCapone,</p>
<p>Sure, I&#8217;d just create an ActionScript function which sets the <code> headerStyleName</code> style to whatever whichever custom style you want. Basically make 2-3+ custom selectors and specify the custom Accordion header skin you want to use:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.customAccordionHeadStyles1</span> <span style="color: #00AA00;">&#123;</span>
    skin<span style="color: #00AA00;">:</span> ClassReference<span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;skins.CustomAccordionHeaderSkin1&quot;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.customAccordionHeadStyles2</span> <span style="color: #00AA00;">&#123;</span>
    skin<span style="color: #00AA00;">:</span> ClassReference<span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;skins.CustomAccordionHeaderSkin2&quot;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.customAccordionHeadStyles3</span> <span style="color: #00AA00;">&#123;</span>
    skin<span style="color: #00AA00;">:</span> ClassReference<span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;skins.CustomAccordionHeaderSkin3&quot;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>And then create some ActionScript functions to set the <code>headerStyleName</code> to whichever CSS selector you want:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> useSkin1<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
    accordion.<span style="color: #004993;">setStyle</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;headerStyleName&quot;</span>, <span style="color: #990000;">&quot;customAccordionHeadStyles1&quot;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span>
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> useSkin2<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
    accordion.<span style="color: #004993;">setStyle</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;headerStyleName&quot;</span>, <span style="color: #990000;">&quot;customAccordionHeadStyles2&quot;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span>
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> useSkin3<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
    accordion.<span style="color: #004993;">setStyle</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;headerStyleName&quot;</span>, <span style="color: #990000;">&quot;customAccordionHeadStyles3&quot;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>You could probably clean up that code significantly, but it may help get you started.</p>
<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AlCapone</title>
		<link>http://blog.flexexamples.com/2009/06/21/creating-a-custom-halo-accordion-header-skin-in-flex-4/comment-page-1/#comment-6464</link>
		<dc:creator>AlCapone</dc:creator>
		<pubDate>Thu, 26 Nov 2009 10:30:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2009/06/21/creating-a-custom-halo-accordion-header-skin-in-flex-4/#comment-6464</guid>
		<description>i have a question...

i want to switch between  2 or more stlyes , can i use a function to change directly the css file??

thanks.</description>
		<content:encoded><![CDATA[<p>i have a question&#8230;</p>
<p>i want to switch between  2 or more stlyes , can i use a function to change directly the css file??</p>
<p>thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel</title>
		<link>http://blog.flexexamples.com/2009/06/21/creating-a-custom-halo-accordion-header-skin-in-flex-4/comment-page-1/#comment-6057</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Mon, 19 Oct 2009 17:47:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2009/06/21/creating-a-custom-halo-accordion-header-skin-in-flex-4/#comment-6057</guid>
		<description>...and as usual the answer is pretty obvious on second glance: commenting out the 

useBaseColor = true;

line allows level3 to show unmodified colors.

DMcQ</description>
		<content:encoded><![CDATA[<p>&#8230;and as usual the answer is pretty obvious on second glance: commenting out the </p>
<p>useBaseColor = true;</p>
<p>line allows level3 to show unmodified colors.</p>
<p>DMcQ</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel</title>
		<link>http://blog.flexexamples.com/2009/06/21/creating-a-custom-halo-accordion-header-skin-in-flex-4/comment-page-1/#comment-6056</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Mon, 19 Oct 2009 17:40:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2009/06/21/creating-a-custom-halo-accordion-header-skin-in-flex-4/#comment-6056</guid>
		<description>If you want to make your header a flat gradient, and not use the highlights, my assumption would be that you could simple comment out the other fill layers and just use layer 3 (changing the gradient fill colors accordinly).

But when I do this, I get a strange shift in color where the colors look much darker than the values I&#039;m putting in. This is probably my ignorance of the skinning framework (maybe the baseLayer attribute is somehow modifying the colors I enter).

Any thoughts on trying to do a flat gradient for the header.

As always, thanks for this immensely helpful site.

Daniel McQ</description>
		<content:encoded><![CDATA[<p>If you want to make your header a flat gradient, and not use the highlights, my assumption would be that you could simple comment out the other fill layers and just use layer 3 (changing the gradient fill colors accordinly).</p>
<p>But when I do this, I get a strange shift in color where the colors look much darker than the values I&#8217;m putting in. This is probably my ignorance of the skinning framework (maybe the baseLayer attribute is somehow modifying the colors I enter).</p>
<p>Any thoughts on trying to do a flat gradient for the header.</p>
<p>As always, thanks for this immensely helpful site.</p>
<p>Daniel McQ</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ruy Adorno</title>
		<link>http://blog.flexexamples.com/2009/06/21/creating-a-custom-halo-accordion-header-skin-in-flex-4/comment-page-1/#comment-4799</link>
		<dc:creator>Ruy Adorno</dc:creator>
		<pubDate>Tue, 28 Jul 2009 15:45:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2009/06/21/creating-a-custom-halo-accordion-header-skin-in-flex-4/#comment-4799</guid>
		<description>Shit, I can&#039;t past the flex code here... the system keeps stripping my code....

This, should be placed inside a fx:Script tag....
&lt;pre lang=&quot;mxml&quot;&gt;
import mx.events.FlexEvent;

[Bindable]
public var __parent:*;

protected function onCreationComplete(event:FlexEvent):void{
	//Get a reference to the &quot;hostComponent&quot;, needed to be used like this 
	//because I couldn&#039;t make the metadata hostComponent work for the mx:VBox component
	__parent = this[&quot;parent&quot;];
	//Hide the original label of flex component
	__parent.getChildAt(0).visible = false;
}
&lt;/pre&gt;

and after that you can use the __parent variable to access the information of the original mx component, just like the hostComponent should work...
In my example I set the first child to false, to hide the original label of mx component... then you should specify another label element and you can retrieve the string value like this:
 text=&quot;{__parent.label}&quot;</description>
		<content:encoded><![CDATA[<p>Shit, I can&#8217;t past the flex code here&#8230; the system keeps stripping my code&#8230;.</p>
<p>This, should be placed inside a fx:Script tag&#8230;.</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;">import mx.events.FlexEvent;
&nbsp;
[Bindable]
public var __parent:*;
&nbsp;
protected function onCreationComplete(event:FlexEvent):void{
	//Get a reference to the &quot;hostComponent&quot;, needed to be used like this 
	//because I couldn't make the metadata hostComponent work for the mx:VBox component
	__parent = this[&quot;parent&quot;];
	//Hide the original label of flex component
	__parent.getChildAt(0).visible = false;
}</pre></div></div>

<p>and after that you can use the __parent variable to access the information of the original mx component, just like the hostComponent should work&#8230;<br />
In my example I set the first child to false, to hide the original label of mx component&#8230; then you should specify another label element and you can retrieve the string value like this:<br />
 text=&#8221;{__parent.label}&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ruy Adorno</title>
		<link>http://blog.flexexamples.com/2009/06/21/creating-a-custom-halo-accordion-header-skin-in-flex-4/comment-page-1/#comment-4798</link>
		<dc:creator>Ruy Adorno</dc:creator>
		<pubDate>Tue, 28 Jul 2009 15:37:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2009/06/21/creating-a-custom-halo-accordion-header-skin-in-flex-4/#comment-4798</guid>
		<description>If there’s any other unfortunates like me browsing this page trying to get the Accordion skin to work well with the flex4, here comes a solution to set also a customized label skin:

First of all, set a creationComplete handler, in the skin class definition:
creationComplete=”onCreationComplete(event)”

After that, just add this script tag, with some magic code to get a reference of the original mx component:

	


After that you can access the properties of your original mx component like this:


This solution is just a complement to the article above, and is not a beautiful one. Hope that in the future someone come with a better and easier solution for this issue.</description>
		<content:encoded><![CDATA[<p>If there’s any other unfortunates like me browsing this page trying to get the Accordion skin to work well with the flex4, here comes a solution to set also a customized label skin:</p>
<p>First of all, set a creationComplete handler, in the skin class definition:<br />
creationComplete=”onCreationComplete(event)”</p>
<p>After that, just add this script tag, with some magic code to get a reference of the original mx component:</p>
<p>After that you can access the properties of your original mx component like this:</p>
<p>This solution is just a complement to the article above, and is not a beautiful one. Hope that in the future someone come with a better and easier solution for this issue.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ruy Adorno</title>
		<link>http://blog.flexexamples.com/2009/06/21/creating-a-custom-halo-accordion-header-skin-in-flex-4/comment-page-1/#comment-4797</link>
		<dc:creator>Ruy Adorno</dc:creator>
		<pubDate>Tue, 28 Jul 2009 15:34:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2009/06/21/creating-a-custom-halo-accordion-header-skin-in-flex-4/#comment-4797</guid>
		<description>If there&#039;s any other unfortunates like me browsing this page trying to get the Accordion skin to work well with the flex4, here comes a solution to set also a customized label skin:

First of all, set a creationComplete handler, in the skin class definition:
creationComplete=&quot;onCreationComplete(event)&quot;

After that, just add this script tag, with some magic code to get a reference of the original mx component:
&lt;code&gt;

		
	
&lt;/code&gt;

After that you can access the properties of your original mx component like this:
&lt;code&gt;

&lt;/code&gt;

This solution is just a complement to the article above, and is not a beautiful one. Hope that in the future someone come with a better and easier solution for this issue.</description>
		<content:encoded><![CDATA[<p>If there&#8217;s any other unfortunates like me browsing this page trying to get the Accordion skin to work well with the flex4, here comes a solution to set also a customized label skin:</p>
<p>First of all, set a creationComplete handler, in the skin class definition:<br />
creationComplete=&#8221;onCreationComplete(event)&#8221;</p>
<p>After that, just add this script tag, with some magic code to get a reference of the original mx component:<br />
<code></p>
<p></code></p>
<p>After that you can access the properties of your original mx component like this:<br />
<code></p>
<p></code></p>
<p>This solution is just a complement to the article above, and is not a beautiful one. Hope that in the future someone come with a better and easier solution for this issue.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
