<?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 toggleable LinkButton control in Flex</title>
	<atom:link href="http://blog.flexexamples.com/2008/09/06/creating-a-toggleable-linkbutton-control-in-flex/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com/2008/09/06/creating-a-toggleable-linkbutton-control-in-flex/</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Sun, 12 Feb 2012 14:19:03 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: John Isaacks</title>
		<link>http://blog.flexexamples.com/2008/09/06/creating-a-toggleable-linkbutton-control-in-flex/comment-page-1/#comment-6826</link>
		<dc:creator>John Isaacks</dc:creator>
		<pubDate>Thu, 21 Jan 2010 21:38:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/09/06/creating-a-toggleable-linkbutton-control-in-flex/#comment-6826</guid>
		<description>So how can I use this to make a ToggleLinkButtonBar?</description>
		<content:encoded><![CDATA[<p>So how can I use this to make a ToggleLinkButtonBar?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Libro</title>
		<link>http://blog.flexexamples.com/2008/09/06/creating-a-toggleable-linkbutton-control-in-flex/comment-page-1/#comment-3791</link>
		<dc:creator>Libro</dc:creator>
		<pubDate>Tue, 28 Oct 2008 19:32:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/09/06/creating-a-toggleable-linkbutton-control-in-flex/#comment-3791</guid>
		<description>What a weird issue to run into but I did.

So, yesterday I was tasked with building a charting app (simple 1 chart based on XML with a refresh interval). No problem...jumped in Flex Builder and banged it out in roughly 20 minutes (not bragging; will explain the reference in a few). The app worked perfectly fine.

Today I was tasked with integrating it into the actual page and putting up a test version to look at. So I did, showed Dave M. (he assigned it to me) but he was busy so I showed my manager, and it didn&#039;t work!!! Huh?

First Error
My manager hit an RSL problem. The issue was with the mime type not being registered in Apache. Easy one to get beyond. I nix&#039;ed the use of RSL for now, until Apache on this server gets updated, and moved one.

Second Error
The code uses a URLLoader to load the XML. I added a listener for HTTPStatusEvent.HTTP_STATUS. 403 and 401 are there for authentication purposes and 200 is the only other I coded. Everything works great. If I get a 200 the timer is stopped then started again. I also have an Event.COMPLETE to &quot;parse&quot; the data and throw it in my chart (which charting+xml is saweet!!!). Again...everything works great. I sent it to my manager...BROKEN! Ahh...only in Firefox though. Huh? How&#039;s that? This is Flash for Christ&#039;s sake!!

I remove my setInterval and replace it with a Timer. That doesn&#039;t work. I tried numerous other fixes and none of those worked. Then I added a double click listener to the chart and had it call loadData which actually worked. So I knew the networking portion was fine. Why in the world is my switch statement not making it to case 200:?

To find out I threw in an Alert.show(event.status) to see what code was coming back. It was 0!!!! HOW? HUH? WHAT?

Last year I learned a new acronym from Sarge. We were working on something and the issue I was having was a result of RTFM. RTFM (to me) reads &quot;Read The Freaking Manual&quot; (substitute your own F* word at your leisure). :-)

That was the problem...RTFM:
bq. &quot;HTTPStatusEvent objects are always sent before error or completion events. An HTTPStatusEvent object does not necessarily indicate an error condition; it simply reflects the HTTP status code (if any) that is provided by the networking stack. Some Flash Player environments may be unable to detect HTTP status codes; a status code of 0 is always reported in these cases.&quot;</description>
		<content:encoded><![CDATA[<p>What a weird issue to run into but I did.</p>
<p>So, yesterday I was tasked with building a charting app (simple 1 chart based on XML with a refresh interval). No problem&#8230;jumped in Flex Builder and banged it out in roughly 20 minutes (not bragging; will explain the reference in a few). The app worked perfectly fine.</p>
<p>Today I was tasked with integrating it into the actual page and putting up a test version to look at. So I did, showed Dave M. (he assigned it to me) but he was busy so I showed my manager, and it didn&#8217;t work!!! Huh?</p>
<p>First Error<br />
My manager hit an RSL problem. The issue was with the mime type not being registered in Apache. Easy one to get beyond. I nix&#8217;ed the use of RSL for now, until Apache on this server gets updated, and moved one.</p>
<p>Second Error<br />
The code uses a URLLoader to load the XML. I added a listener for HTTPStatusEvent.HTTP_STATUS. 403 and 401 are there for authentication purposes and 200 is the only other I coded. Everything works great. If I get a 200 the timer is stopped then started again. I also have an Event.COMPLETE to &#8220;parse&#8221; the data and throw it in my chart (which charting+xml is saweet!!!). Again&#8230;everything works great. I sent it to my manager&#8230;BROKEN! Ahh&#8230;only in Firefox though. Huh? How&#8217;s that? This is Flash for Christ&#8217;s sake!!</p>
<p>I remove my setInterval and replace it with a Timer. That doesn&#8217;t work. I tried numerous other fixes and none of those worked. Then I added a double click listener to the chart and had it call loadData which actually worked. So I knew the networking portion was fine. Why in the world is my switch statement not making it to case 200:?</p>
<p>To find out I threw in an Alert.show(event.status) to see what code was coming back. It was 0!!!! HOW? HUH? WHAT?</p>
<p>Last year I learned a new acronym from Sarge. We were working on something and the issue I was having was a result of RTFM. RTFM (to me) reads &#8220;Read The Freaking Manual&#8221; (substitute your own F* word at your leisure). :-)</p>
<p>That was the problem&#8230;RTFM:<br />
bq. &#8220;HTTPStatusEvent objects are always sent before error or completion events. An HTTPStatusEvent object does not necessarily indicate an error condition; it simply reflects the HTTP status code (if any) that is provided by the networking stack. Some Flash Player environments may be unable to detect HTTP status codes; a status code of 0 is always reported in these cases.&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peterd</title>
		<link>http://blog.flexexamples.com/2008/09/06/creating-a-toggleable-linkbutton-control-in-flex/comment-page-1/#comment-3786</link>
		<dc:creator>peterd</dc:creator>
		<pubDate>Tue, 09 Sep 2008 06:07:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/09/06/creating-a-toggleable-linkbutton-control-in-flex/#comment-3786</guid>
		<description>Dave,

I was thinking something along the lines of this: &lt;a href=&quot;http://blog.flexexamples.com/2008/09/08/extending-the-linkbutton-control-in-flex/&quot; rel=&quot;nofollow&quot;&gt;&lt;u&gt;&quot;Extending the LinkButton control in Flex&quot;&lt;/u&gt;&lt;/a&gt;.

I extended the LinkButton control and added my new style, &lt;code&gt;toggleBackgroundColor&lt;/code&gt;.
Next, in my custom LinkButton skin, I used that new style in the &quot;selectedUpSkin&quot;, &quot;selectedOverSkin&quot;, and &quot;selectedDisabledSkin&quot; skin states.

Peter</description>
		<content:encoded><![CDATA[<p>Dave,</p>
<p>I was thinking something along the lines of this: <a href="http://blog.flexexamples.com/2008/09/08/extending-the-linkbutton-control-in-flex/" rel="nofollow"><u>&#8220;Extending the LinkButton control in Flex&#8221;</u></a>.</p>
<p>I extended the LinkButton control and added my new style, <code>toggleBackgroundColor</code>.<br />
Next, in my custom LinkButton skin, I used that new style in the &#8220;selectedUpSkin&#8221;, &#8220;selectedOverSkin&#8221;, and &#8220;selectedDisabledSkin&#8221; skin states.</p>
<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://blog.flexexamples.com/2008/09/06/creating-a-toggleable-linkbutton-control-in-flex/comment-page-1/#comment-3785</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Mon, 08 Sep 2008 21:18:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/09/06/creating-a-toggleable-linkbutton-control-in-flex/#comment-3785</guid>
		<description>I&#039;ll answer my own question.  I was able to access the LinkButton that was calling the ToggleLinkButtonSkin class by casting the parent as a LinkButton:

var lbtn_ref:LinkButton = (LinkButton)(this.parent);

From there, I could determine what color I wanted to style the button based on the button&#039;s label.</description>
		<content:encoded><![CDATA[<p>I&#8217;ll answer my own question.  I was able to access the LinkButton that was calling the ToggleLinkButtonSkin class by casting the parent as a LinkButton:</p>
<p>var lbtn_ref:LinkButton = (LinkButton)(this.parent);</p>
<p>From there, I could determine what color I wanted to style the button based on the button&#8217;s label.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peterd</title>
		<link>http://blog.flexexamples.com/2008/09/06/creating-a-toggleable-linkbutton-control-in-flex/comment-page-1/#comment-3789</link>
		<dc:creator>peterd</dc:creator>
		<pubDate>Mon, 08 Sep 2008 20:44:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/09/06/creating-a-toggleable-linkbutton-control-in-flex/#comment-3789</guid>
		<description>Dave,

I believe the example above uses the existing &lt;code&gt;selectionColor&lt;/code&gt; for the &quot;selectedDownSkin&quot; state. If you wanted to use a separate color, you could probably get away with extending the LinkButton control, add metadata for a new &quot;selectedToggleStyle&quot; style and use that color in your custom ToggleLinkButtonSkin skin instead.

I can try taking a look at it again tonight and see if I can create a new example.

Peter</description>
		<content:encoded><![CDATA[<p>Dave,</p>
<p>I believe the example above uses the existing <code>selectionColor</code> for the &#8220;selectedDownSkin&#8221; state. If you wanted to use a separate color, you could probably get away with extending the LinkButton control, add metadata for a new &#8220;selectedToggleStyle&#8221; style and use that color in your custom ToggleLinkButtonSkin skin instead.</p>
<p>I can try taking a look at it again tonight and see if I can create a new example.</p>
<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://blog.flexexamples.com/2008/09/06/creating-a-toggleable-linkbutton-control-in-flex/comment-page-1/#comment-3788</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Mon, 08 Sep 2008 19:50:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/09/06/creating-a-toggleable-linkbutton-control-in-flex/#comment-3788</guid>
		<description>How would I go about using this in a way that would allow me to control the color of the LinkButton?  Do I need to create a separate ToggleLinkButtonSkin class for each color I intend to use?</description>
		<content:encoded><![CDATA[<p>How would I go about using this in a way that would allow me to control the color of the LinkButton?  Do I need to create a separate ToggleLinkButtonSkin class for each color I intend to use?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: morphy</title>
		<link>http://blog.flexexamples.com/2008/09/06/creating-a-toggleable-linkbutton-control-in-flex/comment-page-1/#comment-3787</link>
		<dc:creator>morphy</dc:creator>
		<pubDate>Mon, 08 Sep 2008 14:34:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/09/06/creating-a-toggleable-linkbutton-control-in-flex/#comment-3787</guid>
		<description>@xiangjiazhao : first click the button. Nothing happens. Then check &quot;Toggle&quot; and click the button again. You see the difference ? The button now behaves like a checkbox.</description>
		<content:encoded><![CDATA[<p>@xiangjiazhao : first click the button. Nothing happens. Then check &#8220;Toggle&#8221; and click the button again. You see the difference ? The button now behaves like a checkbox.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: xiangjiazhao</title>
		<link>http://blog.flexexamples.com/2008/09/06/creating-a-toggleable-linkbutton-control-in-flex/comment-page-1/#comment-3790</link>
		<dc:creator>xiangjiazhao</dc:creator>
		<pubDate>Sun, 07 Sep 2008 02:42:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/09/06/creating-a-toggleable-linkbutton-control-in-flex/#comment-3790</guid>
		<description>when i check &quot;toggle&quot;,there is no change.</description>
		<content:encoded><![CDATA[<p>when i check &#8220;toggle&#8221;,there is no change.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

