<?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: Programmatic Button Skins in Flex 3</title>
	<atom:link href="http://www.davidflatley.com/2007/12/17/programmatic-button-skins-in-flex-3/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.davidflatley.com/2007/12/17/programmatic-button-skins-in-flex-3/</link>
	<description>A RIA developer's late night ramblings and other nonsense</description>
	<lastBuildDate>Sun, 09 May 2010 09:59:29 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
	<item>
		<title>By: How to UnFlex Your Flex – Making Flex applications look and feel unique</title>
		<link>http://www.davidflatley.com/2007/12/17/programmatic-button-skins-in-flex-3/comment-page-1/#comment-1780</link>
		<dc:creator>How to UnFlex Your Flex – Making Flex applications look and feel unique</dc:creator>
		<pubDate>Fri, 19 Dec 2008 08:13:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidflatley.com/?p=22#comment-1780</guid>
		<description>[...] http://www.davidflatley.com/2007/12/17/programmatic-button-skins-in-flex-3/ [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://www.davidflatley.com/2007/12/17/programmatic-button-skins-in-flex-3/" rel="nofollow">http://www.davidflatley.com/2007/12/17/programmatic-button-skins-in-flex-3/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://www.davidflatley.com/2007/12/17/programmatic-button-skins-in-flex-3/comment-page-1/#comment-1757</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Thu, 11 Dec 2008 15:01:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidflatley.com/?p=22#comment-1757</guid>
		<description>Hey Kareem,
What kind of issues are you running into? Adobe posted some new stuff since this post http://livedocs.adobe.com/flex/3/html/help.html?content=skinning_6.html

Take a look and see if that helps.</description>
		<content:encoded><![CDATA[<p>Hey Kareem,<br />
What kind of issues are you running into? Adobe posted some new stuff since this post <a href="http://livedocs.adobe.com/flex/3/html/help.html?content=skinning_6.html" rel="nofollow">http://livedocs.adobe.com/flex/3/html/help.html?content=skinning_6.html</a></p>
<p>Take a look and see if that helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kareem</title>
		<link>http://www.davidflatley.com/2007/12/17/programmatic-button-skins-in-flex-3/comment-page-1/#comment-1755</link>
		<dc:creator>Kareem</dc:creator>
		<pubDate>Thu, 11 Dec 2008 04:50:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidflatley.com/?p=22#comment-1755</guid>
		<description>Hi,

Thanks for the example, I am trying to combine the Rounded button with the Gradient button examples and seem to be running into some issues with getting this to work.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Thanks for the example, I am trying to combine the Rounded button with the Gradient button examples and seem to be running into some issues with getting this to work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://www.davidflatley.com/2007/12/17/programmatic-button-skins-in-flex-3/comment-page-1/#comment-1343</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Mon, 22 Sep 2008 14:48:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidflatley.com/?p=22#comment-1343</guid>
		<description>How about percentWidth and percentHeight instead of unscaledWidth/height? I know it takes care of some issues with Modules. It might fix the issue you&#039;re having with the triangles.</description>
		<content:encoded><![CDATA[<p>How about percentWidth and percentHeight instead of unscaledWidth/height? I know it takes care of some issues with Modules. It might fix the issue you&#8217;re having with the triangles.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jake</title>
		<link>http://www.davidflatley.com/2007/12/17/programmatic-button-skins-in-flex-3/comment-page-1/#comment-1341</link>
		<dc:creator>Jake</dc:creator>
		<pubDate>Mon, 22 Sep 2008 14:38:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidflatley.com/?p=22#comment-1341</guid>
		<description>Hey Dave,

What I&#039;m posting was placed at the bottom of the code you&#039;ve provided here on this page. The code draws two different triangles (one for each selected state of a toggle button) and then hides both of them. It then uses another switch statement to show and hide them based on which button skin is being asked for.

I have a sneaking suspicion that there is a more elegant way to do this . . . and the one issue I&#039;m still having is that if the button ever gets redrawn because of parent container widths, I end up with two triangles side by side. Very strange. But this only happens with percentage based button widths. If you have a fixed width, this is a non-issue.

Here&#039;s the code:

var triangleHeight:uint = 8;
var triangle:Shape = new Shape();
var triangle2:Shape = new Shape();

triangle.graphics.beginFill(0xFFFFFF);
triangle.graphics.moveTo((unscaledWidth - 18), 4);
triangle.graphics.lineTo((unscaledWidth - 18) + triangleHeight/2, triangleHeight);
triangle.graphics.lineTo((unscaledWidth - 18), triangleHeight + 4);
triangle.graphics.lineTo((unscaledWidth - 18), 4);
this.addChild(triangle);
triangle.visible = false;
			
triangle2.graphics.beginFill(0xFFFFFF);
triangle2.graphics.moveTo((unscaledWidth - 20), triangleHeight);
triangle2.graphics.lineTo((unscaledWidth - 20) + triangleHeight, triangleHeight);
triangle2.graphics.lineTo((unscaledWidth - 20) + 4, triangleHeight + 4);
triangle2.graphics.lineTo((unscaledWidth - 20), triangleHeight);
this.addChild(triangle2);
triangle2.visible = false;
			
switch(name) {
	case &quot;upSkin&quot;:
		triangle2.visible = false;
		triangle.visible = true;
		break;
	case &quot;overSkin&quot;:
		triangle2.visible = false;
		triangle.visible = true;
		break;
	case &quot;downSkin&quot;:
		triangle2.visible = false;
		triangle.visible = true;
		break;
	case &quot;selectedUpSkin&quot;:
		triangle.visible = false;
		triangle2.visible = true;
		break;
	case &quot;selectedOverSkin&quot;:
		triangle.visible = false;
		triangle2.visible = true;
		break;
	case &quot;selectedDownSkin&quot;:
		triangle.visible = false;
		triangle2.visible = true;
		break;
	case &quot;disabledSkin&quot;:
		triangle.visible = false;
		triangle2.visible = true;
		break;</description>
		<content:encoded><![CDATA[<p>Hey Dave,</p>
<p>What I&#8217;m posting was placed at the bottom of the code you&#8217;ve provided here on this page. The code draws two different triangles (one for each selected state of a toggle button) and then hides both of them. It then uses another switch statement to show and hide them based on which button skin is being asked for.</p>
<p>I have a sneaking suspicion that there is a more elegant way to do this . . . and the one issue I&#8217;m still having is that if the button ever gets redrawn because of parent container widths, I end up with two triangles side by side. Very strange. But this only happens with percentage based button widths. If you have a fixed width, this is a non-issue.</p>
<p>Here&#8217;s the code:</p>
<p>var triangleHeight:uint = 8;<br />
var triangle:Shape = new Shape();<br />
var triangle2:Shape = new Shape();</p>
<p>triangle.graphics.beginFill(0xFFFFFF);<br />
triangle.graphics.moveTo((unscaledWidth &#8211; 18), 4);<br />
triangle.graphics.lineTo((unscaledWidth &#8211; 18) + triangleHeight/2, triangleHeight);<br />
triangle.graphics.lineTo((unscaledWidth &#8211; 18), triangleHeight + 4);<br />
triangle.graphics.lineTo((unscaledWidth &#8211; 18), 4);<br />
this.addChild(triangle);<br />
triangle.visible = false;</p>
<p>triangle2.graphics.beginFill(0xFFFFFF);<br />
triangle2.graphics.moveTo((unscaledWidth &#8211; 20), triangleHeight);<br />
triangle2.graphics.lineTo((unscaledWidth &#8211; 20) + triangleHeight, triangleHeight);<br />
triangle2.graphics.lineTo((unscaledWidth &#8211; 20) + 4, triangleHeight + 4);<br />
triangle2.graphics.lineTo((unscaledWidth &#8211; 20), triangleHeight);<br />
this.addChild(triangle2);<br />
triangle2.visible = false;</p>
<p>switch(name) {<br />
	case &#8220;upSkin&#8221;:<br />
		triangle2.visible = false;<br />
		triangle.visible = true;<br />
		break;<br />
	case &#8220;overSkin&#8221;:<br />
		triangle2.visible = false;<br />
		triangle.visible = true;<br />
		break;<br />
	case &#8220;downSkin&#8221;:<br />
		triangle2.visible = false;<br />
		triangle.visible = true;<br />
		break;<br />
	case &#8220;selectedUpSkin&#8221;:<br />
		triangle.visible = false;<br />
		triangle2.visible = true;<br />
		break;<br />
	case &#8220;selectedOverSkin&#8221;:<br />
		triangle.visible = false;<br />
		triangle2.visible = true;<br />
		break;<br />
	case &#8220;selectedDownSkin&#8221;:<br />
		triangle.visible = false;<br />
		triangle2.visible = true;<br />
		break;<br />
	case &#8220;disabledSkin&#8221;:<br />
		triangle.visible = false;<br />
		triangle2.visible = true;<br />
		break;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://www.davidflatley.com/2007/12/17/programmatic-button-skins-in-flex-3/comment-page-1/#comment-1340</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Mon, 22 Sep 2008 14:04:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidflatley.com/?p=22#comment-1340</guid>
		<description>Hey Jake,
Awesome, glad to hear it! I&#039;d be interested to see how it fits together if you want to post the code. Might be other people who would be interested to see it work too. 

Good work man, thanks for getting back to me!</description>
		<content:encoded><![CDATA[<p>Hey Jake,<br />
Awesome, glad to hear it! I&#8217;d be interested to see how it fits together if you want to post the code. Might be other people who would be interested to see it work too. </p>
<p>Good work man, thanks for getting back to me!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jake</title>
		<link>http://www.davidflatley.com/2007/12/17/programmatic-button-skins-in-flex-3/comment-page-1/#comment-1339</link>
		<dc:creator>Jake</dc:creator>
		<pubDate>Mon, 22 Sep 2008 13:53:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidflatley.com/?p=22#comment-1339</guid>
		<description>Hey Dave,

Thanks so much for the shove in the right direction. It did, in fact, work! I really appreciate it.</description>
		<content:encoded><![CDATA[<p>Hey Dave,</p>
<p>Thanks so much for the shove in the right direction. It did, in fact, work! I really appreciate it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://www.davidflatley.com/2007/12/17/programmatic-button-skins-in-flex-3/comment-page-1/#comment-1311</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Fri, 19 Sep 2008 01:19:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidflatley.com/?p=22#comment-1311</guid>
		<description>Hey Jake,
No problem. I believe it&#039;s totally possible. Here&#039;s some fancy triangle code http://livedocs.adobe.com/flex/3/html/help.html?content=Drawing_Vector_Graphics_4.html

I&#039;d make sure to addChild() on top of the gradient background so that it shows up on screen. Give that a try and let me know how it goes.</description>
		<content:encoded><![CDATA[<p>Hey Jake,<br />
No problem. I believe it&#8217;s totally possible. Here&#8217;s some fancy triangle code <a href="http://livedocs.adobe.com/flex/3/html/help.html?content=Drawing_Vector_Graphics_4.html" rel="nofollow">http://livedocs.adobe.com/flex/3/html/help.html?content=Drawing_Vector_Graphics_4.html</a></p>
<p>I&#8217;d make sure to addChild() on top of the gradient background so that it shows up on screen. Give that a try and let me know how it goes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jake</title>
		<link>http://www.davidflatley.com/2007/12/17/programmatic-button-skins-in-flex-3/comment-page-1/#comment-1308</link>
		<dc:creator>Jake</dc:creator>
		<pubDate>Thu, 18 Sep 2008 22:16:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidflatley.com/?p=22#comment-1308</guid>
		<description>Hi Dave!

Thanks so much for the post. Very helpful! I have a follow up question:

Is it possible to draw a shape on top of a programmatic button? What I&#039;d like to do is add a triangle to a programmatic button so that if the toggle state is set to &quot;true&quot; it would look like an accordion button. Ideally, I&#039;d like to see the triangle redrawn for the selected state of the button so that it is pointing down rather than to the side.

Is something like this possible? Or do I need to stick with a .png or .swc skinning technique for this?</description>
		<content:encoded><![CDATA[<p>Hi Dave!</p>
<p>Thanks so much for the post. Very helpful! I have a follow up question:</p>
<p>Is it possible to draw a shape on top of a programmatic button? What I&#8217;d like to do is add a triangle to a programmatic button so that if the toggle state is set to &#8220;true&#8221; it would look like an accordion button. Ideally, I&#8217;d like to see the triangle redrawn for the selected state of the button so that it is pointing down rather than to the side.</p>
<p>Is something like this possible? Or do I need to stick with a .png or .swc skinning technique for this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://www.davidflatley.com/2007/12/17/programmatic-button-skins-in-flex-3/comment-page-1/#comment-7</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Mon, 17 Dec 2007 22:33:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidflatley.com/?p=22#comment-7</guid>
		<description>Gareth,
I use the wp-syntax plugin for WordPress, which works great. http://wordpress.org/extend/plugins/wp-syntax/page/2#post-1246

There&#039;s no built in MXML highlighter, so I found this one on defusion.org http://www.defusion.org.uk/archives/2007/10/04/code-mxml-geshi-language-file/

It&#039;s pretty decent, though it will change the case sensitivity of the mxml tags, you have to make sure they stay the way you want them if you edit your post. 

Enjoy!

Dave</description>
		<content:encoded><![CDATA[<p>Gareth,<br />
I use the wp-syntax plugin for WordPress, which works great. <a href="http://wordpress.org/extend/plugins/wp-syntax/page/2#post-1246" rel="nofollow">http://wordpress.org/extend/plugins/wp-syntax/page/2#post-1246</a></p>
<p>There&#8217;s no built in MXML highlighter, so I found this one on defusion.org <a href="http://www.defusion.org.uk/archives/2007/10/04/code-mxml-geshi-language-file/" rel="nofollow">http://www.defusion.org.uk/archives/2007/10/04/code-mxml-geshi-language-file/</a></p>
<p>It&#8217;s pretty decent, though it will change the case sensitivity of the mxml tags, you have to make sure they stay the way you want them if you edit your post. </p>
<p>Enjoy!</p>
<p>Dave</p>
]]></content:encoded>
	</item>
</channel>
</rss>
