<?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: Styling Flexlib&#8217;s WindowShade</title>
	<atom:link href="http://saturnboy.com/2009/03/styling-flexlib-windowshade/feed/" rel="self" type="application/rss+xml" />
	<link>http://saturnboy.com/2009/03/styling-flexlib-windowshade/</link>
	<description>Code, Work, and Life</description>
	<lastBuildDate>Wed, 25 Aug 2010 09:44:49 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: justin</title>
		<link>http://saturnboy.com/2009/03/styling-flexlib-windowshade/comment-page-1/#comment-141</link>
		<dc:creator>justin</dc:creator>
		<pubDate>Wed, 19 May 2010 16:16:00 +0000</pubDate>
		<guid isPermaLink="false">http://saturnboy.com/?p=246#comment-141</guid>
		<description>@Umesh:  If you want to change the style at runtime, the easiest thing to do is to use &lt;code&gt;getStyle()&lt;/code&gt; and &lt;code&gt;setStyle()&lt;/code&gt;.

So, if I wanted to switch styles on the header on open &amp; close, I just listen for the correct events and use &lt;code&gt;setStyle()&lt;/code&gt; to make the switch.

&lt;pre lang=&quot;actionscript&quot;&gt;
shade.addEventListener(WindowShadeEvent.OPEN_BEGIN,
    function(e:Event):void {
        shade.setStyle(&#039;headerStyleName&#039;, &#039;headOpen&#039;);
    });
shade.addEventListener(WindowShadeEvent.CLOSE_END,
    function(e:Event):void {
        shade.setStyle(&#039;headerStyleName&#039;, &#039;headClose&#039;);
    });
&lt;/pre&gt;

And then define two CSS styles for &lt;code&gt;headOpen&lt;/code&gt; and &lt;code&gt;headClose&lt;/code&gt; with different background colors.

Good luck.</description>
		<content:encoded><![CDATA[<p>@Umesh:  If you want to change the style at runtime, the easiest thing to do is to use <code>getStyle()</code> and <code>setStyle()</code>.</p>
<p>So, if I wanted to switch styles on the header on open &#038; close, I just listen for the correct events and use <code>setStyle()</code> to make the switch.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">shade.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>WindowShadeEvent.<span style="color: #006600;">OPEN_BEGIN</span>,
    <span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
        shade.<span style="color: #0066CC;">setStyle</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'headerStyleName'</span>, <span style="color: #ff0000;">'headOpen'</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
shade.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>WindowShadeEvent.<span style="color: #006600;">CLOSE_END</span>,
    <span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
        shade.<span style="color: #0066CC;">setStyle</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'headerStyleName'</span>, <span style="color: #ff0000;">'headClose'</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>And then define two CSS styles for <code>headOpen</code> and <code>headClose</code> with different background colors.</p>
<p>Good luck.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Umesh</title>
		<link>http://saturnboy.com/2009/03/styling-flexlib-windowshade/comment-page-1/#comment-138</link>
		<dc:creator>Umesh</dc:creator>
		<pubDate>Wed, 19 May 2010 12:28:05 +0000</pubDate>
		<guid isPermaLink="false">http://saturnboy.com/?p=246#comment-138</guid>
		<description>Hi, 
Thanks for a very good example. I wanted to know how can I have a different header colors applied. I want the header to have a one color when window shade is open and another color when it is closed.

Any help will be much appreciated.  Using the most recent Flex 4 version.</description>
		<content:encoded><![CDATA[<p>Hi,<br />
Thanks for a very good example. I wanted to know how can I have a different header colors applied. I want the header to have a one color when window shade is open and another color when it is closed.</p>
<p>Any help will be much appreciated.  Using the most recent Flex 4 version.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joel</title>
		<link>http://saturnboy.com/2009/03/styling-flexlib-windowshade/comment-page-1/#comment-81</link>
		<dc:creator>Joel</dc:creator>
		<pubDate>Mon, 22 Feb 2010 14:54:21 +0000</pubDate>
		<guid isPermaLink="false">http://saturnboy.com/?p=246#comment-81</guid>
		<description>Excellent guide.  Helped a ton.  Thanks!</description>
		<content:encoded><![CDATA[<p>Excellent guide.  Helped a ton.  Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: justin</title>
		<link>http://saturnboy.com/2009/03/styling-flexlib-windowshade/comment-page-1/#comment-8</link>
		<dc:creator>justin</dc:creator>
		<pubDate>Fri, 27 Mar 2009 15:27:56 +0000</pubDate>
		<guid isPermaLink="false">http://saturnboy.com/?p=246#comment-8</guid>
		<description>As I mentioned above, I&#039;m using a CanvasButton in the headerRenderer of the WindowShade.  The CanvasButton hold three components: a Label, a CheckBox, and a basic Canvas.  The key to making the entire CanvasButton clickable is the extra Canvas, which is space-filling and transparent:

&lt;code&gt;&lt;mx:Canvas width=&quot;100%&quot; height=&quot;100%&quot;&lt;br /&gt;&#160;&#160;&#160;&#160;backgroundColor=&quot;#000000&quot; backgroundAlpha=&quot;0&quot; /&gt;&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>As I mentioned above, I&#8217;m using a CanvasButton in the headerRenderer of the WindowShade.  The CanvasButton hold three components: a Label, a CheckBox, and a basic Canvas.  The key to making the entire CanvasButton clickable is the extra Canvas, which is space-filling and transparent:</p>
<p><code>&lt;mx:Canvas width=&quot;100%&quot; height=&quot;100%&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;backgroundColor=&quot;#000000&quot; backgroundAlpha=&quot;0&quot; /&gt;</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sandeep</title>
		<link>http://saturnboy.com/2009/03/styling-flexlib-windowshade/comment-page-1/#comment-7</link>
		<dc:creator>sandeep</dc:creator>
		<pubDate>Thu, 26 Mar 2009 15:50:29 +0000</pubDate>
		<guid isPermaLink="false">http://saturnboy.com/?p=246#comment-7</guid>
		<description>Hi,

Happened to do the same thing what you and faced the same problem and the only difference is that i couldn&#039;t resolve the issue you faced. I am not able to roll over or roll out a windowshade when clicked on Windowshade apart from the label. I have included a Label with in the Windowshade but it has made windowshade rolldown functionality to fail. Can you please look at the code and let me know where things have failed, I have tried all the possible ways but failed. 

Please find my code below...

and my actionscript methods...

public static function onBackDown(event:Event):void {
	ModelLocator.getInstance().dispatchEvent(new Event(&quot;LabelClicked&quot;));	    
}		

public static function onBackClick(event:Event):void {
	event.stopPropagation();
}	

Would appreciate if you could suggest a solution...

Thanks</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Happened to do the same thing what you and faced the same problem and the only difference is that i couldn&#8217;t resolve the issue you faced. I am not able to roll over or roll out a windowshade when clicked on Windowshade apart from the label. I have included a Label with in the Windowshade but it has made windowshade rolldown functionality to fail. Can you please look at the code and let me know where things have failed, I have tried all the possible ways but failed. </p>
<p>Please find my code below&#8230;</p>
<p>and my actionscript methods&#8230;</p>
<p>public static function onBackDown(event:Event):void {<br />
	ModelLocator.getInstance().dispatchEvent(new Event(&#8220;LabelClicked&#8221;));<br />
}		</p>
<p>public static function onBackClick(event:Event):void {<br />
	event.stopPropagation();<br />
}	</p>
<p>Would appreciate if you could suggest a solution&#8230;</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
</channel>
</rss>
