<?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>blackcj.com &#187; Skinning</title>
	<atom:link href="http://www.blackcj.com/blog/tag/skinning/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.blackcj.com/blog</link>
	<description>Cutting edge development with Adobe Flex, ActionScript and AIR</description>
	<lastBuildDate>Thu, 15 Dec 2011 01:01:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Skimmer</title>
		<link>http://www.blackcj.com/blog/2009/03/24/skimmer/</link>
		<comments>http://www.blackcj.com/blog/2009/03/24/skimmer/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 06:51:25 +0000</pubDate>
		<dc:creator>Chris Black</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Skinning]]></category>
		<category><![CDATA[SQLite]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[YouTube]]></category>

		<guid isPermaLink="false">http://www.blackcj.com/blog/?p=275</guid>
		<description><![CDATA[&#8220;A lifestreaming thing that lets you see it all in one place&#8221; Skimmer. The next Adobe AIR app and the hard work of many individuals over the past 6 months. It has been amazing to see this application turn from design into reality. This is a summary of the technologies used and some of the [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;A lifestreaming thing that lets you see it all in one place&#8221; </p>
<p>Skimmer.  The next Adobe AIR app and the hard work of many individuals over the past 6 months.  It has been amazing to see this application turn from design into reality.  This is a summary of the technologies used and some of the lessons learned throughout the development of Skimmer:</p>
<div id="attachment_277" class="wp-caption alignnone" style="width: 310px"><img src="http://www.blackcj.com/blog/wp-content/uploads/2009/03/skimmer-300x106.png" alt="Skimmer" title="Skimmer" width="300" height="106" class="size-medium wp-image-277" /><p class="wp-caption-text">Skimmer</p></div>
<p>The first decision was easy.  Use an MVC framework, more specifically PureMVC.  This application was estimated in the thousands and having a backbone was very important.  We spent the extra time upfront developing a solid structure which ended up helping out immensely when it came to bug fix and adding new features.  Creating new views became a snap when the data providers that accessed third party API&#8217;s were completed.</p>
<p>The second major decision was to use a SQLite database to store content locally.  This allowed for fast filtering of data and pre-processing of information.  It also greatly improved the load time of the application since we only needed to gather new information.</p>
<p>Thirdly, we decided to use image caching for all of the commonly used images to improve load times.  This increased the application start up and allows for fluid transitions between images in slide shows.  By extending a bulk loader class Skimmer is able to first check the local cache before making any requests to the internet for images.</p>
<p>One of the major challenge was working with the third party API&#8217;s.  The API&#8217;s for Flickr, YouTube, Twitter, TwitPic, Facebook and Blogger had varying levels of documentation and support.  Flickr had the most feature rich API while Facebook had the most difficult API to work with.  Many of them had third party AS3 libraries to use for interfacing with the service that we used as a base.</p>
<p>Another challenge was in skinning the flex components.  The application was not designed to look like an AIR application, which is a good thing <img src='http://www.blackcj.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   This, however, did create some interesting problems along the way.  We used a combination of CSS, class inheritance, overrode drawing methods, and even created some custom flex components.</p>
<p><strong>You can download skimmer here:</strong><br />
<a href="http://www.fallon.com/skimmer">http://www.fallon.com/skimmer </a></p>
<p>A shout out to everyone that made this happen:<br />
AL KELLY, BRENDA FOGG, CHRIS WIGGINS, DAVID SCHWEN. EXTENDED TEAM: ANDY GUGEL, SIERRA BRAVO, ANDREW WATSON, BEN DOLMAR, BLAGVOST DACHEV, CLAYTON SMITH, JON REXEISEN, KARSTEN LUNDQUIST, KONR NESS, KRIS SZAFRANSKI, MARK SEEMANN, MANISH SHRESTHA, MATT TONAK, MICHAEL WOODS, MINH VU, ROBB THOMAS, THOMAS O&#8217;NEILL.</p>
<p>Feel free to post any comments or questions you have about Skimmer.</p>
<p><a href="http://mashable.com/2009/03/24/skimmer/">http://mashable.com/2009/03/24/skimmer/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.blackcj.com/blog/2009/03/24/skimmer/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>How to Fix Fuzzy Pixels in Flex</title>
		<link>http://www.blackcj.com/blog/2009/03/10/how-to-fix-fuzzy-pixels-in-flex/</link>
		<comments>http://www.blackcj.com/blog/2009/03/10/how-to-fix-fuzzy-pixels-in-flex/#comments</comments>
		<pubDate>Tue, 10 Mar 2009 16:16:52 +0000</pubDate>
		<dc:creator>Chris Black</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Photoshop]]></category>
		<category><![CDATA[Skinning]]></category>
		<category><![CDATA[Sprite]]></category>

		<guid isPermaLink="false">http://www.blackcj.com/blog/?p=264</guid>
		<description><![CDATA[What are fuzzy pixels? Semi-transparent lines that appear on the edges of your Sprites that make them appear fuzzy or blurry. This is the result of positioning a custom drawn Sprite (using the graphics property) on non-whole number pixels (for example myObject.x = 1.5). Your probably wondering why anyone would set a Sprite to an [...]]]></description>
			<content:encoded><![CDATA[<p>What are fuzzy pixels?  Semi-transparent lines that appear on the edges of your Sprites that make them appear fuzzy or blurry.  This is the result of positioning a custom drawn Sprite (using the graphics property) on non-whole number pixels (for example myObject.x = 1.5). </p>
<p>Your probably wondering why anyone would set a Sprite to an decimal number of pixels?  Well, most of the time this occurs when the positioning is based off of a mathematical equation.  For example: myObject.x = this.width / 2.  This would produce 50.5 if the width of the container is 101.  One of the biggest problems with this is that the fuzzy pixel problem has a waterfall effect.  Everything contained within that sprite placed at a decimal number position will have semi-transparent edges.  Another reason would be designers that set positioning of items to half pixels in Photoshop and attempting to reproduce the design pixel perfect in Flex.</p>
<p>Here is a zoomed in picture of what fuzzy pixels look like.  The first and second squares are drawn using the same drawing function.  One is placed on an even pixel and the other at a decimal number.</p>
<div id="attachment_268" class="wp-caption alignnone" style="width: 586px"><img src="http://www.blackcj.com/blog/wp-content/uploads/2009/03/fuzzypixels.png" alt="Fuzzy Pixels (Semi-Transparent Lines)" title="Fuzzy Pixels" width="576" height="210" class="size-full wp-image-268" /><p class="wp-caption-text">Fuzzy Pixels (Semi-Transparent Lines)</p></div>
<p>Code that produces fuzzy pixels:</p>
<div class="igBar"><span id="lactionscript-2"><a href="#" onclick="javascript:showPlainTxt('actionscript-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-2">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> fuzzySquare:Sprite;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> square:Sprite;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> squareContainer:Sprite;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> draw<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; squareContainer = <span style="color: #000000; font-weight: bold;">new</span> Sprite<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; squareContainer.<span style="color: #006600;">x</span> = <span style="color: #cc66cc;color:#800000;">1</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; squareContainer.<span style="color: #006600;">y</span> = <span style="color: #cc66cc;color:#800000;">1</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; square = <span style="color: #000000; font-weight: bold;">new</span> Sprite<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; square.<span style="color: #006600;">x</span> = <span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; square.<span style="color: #006600;">y</span> = <span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; square.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">clear</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; square.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">beginFill</span><span style="color: #66cc66;">&#40;</span>0x0000FF<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; square.<span style="color: #006600;">graphics</span>.<span style="color: #006600;">drawRect</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">0</span>,<span style="color: #cc66cc;color:#800000;">0</span>,<span style="color: #cc66cc;color:#800000;">30</span>,<span style="color: #cc66cc;color:#800000;">20</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; square.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">endFill</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; squareContainer.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>square<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; fuzzySquare = <span style="color: #000000; font-weight: bold;">new</span> Sprite<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; fuzzySquare.<span style="color: #006600;">x</span> = square.<span style="color: #006600;">x</span> + square.<span style="color: #0066CC;">width</span> + <span style="color: #cc66cc;color:#800000;">3</span>.<span style="color: #cc66cc;color:#800000;">5</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; fuzzySquare.<span style="color: #006600;">y</span> = <span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; fuzzySquare.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">clear</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; fuzzySquare.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">beginFill</span><span style="color: #66cc66;">&#40;</span>0x0000FF<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; fuzzySquare.<span style="color: #006600;">graphics</span>.<span style="color: #006600;">drawRect</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">0</span>,<span style="color: #cc66cc;color:#800000;">0</span>,<span style="color: #cc66cc;color:#800000;">30</span>,<span style="color: #cc66cc;color:#800000;">20</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; fuzzySquare.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">endFill</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; squareContainer.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>fuzzySquare<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; container.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>squareContainer<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>Solutions:</strong><br />
Use Math.floor or Math.ceil on all mathematical calculations relating to the positioning of Sprites drawn with the graphics function.</p>
<p>or</p>
<p>Rather than draw out the Sprite using graphics you could convert your sprites to images, embed them, and position them on the stage.  This is the best approach when tweening is necessary requiring the object to look crisp at all times.</p>
<p><em>Note: I've seen this occur on odd number pixels as well but that is most likely the result of a greater positioning problem.  This generally only occurs in highly nested display objects.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.blackcj.com/blog/2009/03/10/how-to-fix-fuzzy-pixels-in-flex/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Skinning Flex Components &#8211; Part 1: CSS</title>
		<link>http://www.blackcj.com/blog/2009/01/06/skinning-flex-components-part-1-css/</link>
		<comments>http://www.blackcj.com/blog/2009/01/06/skinning-flex-components-part-1-css/#comments</comments>
		<pubDate>Wed, 07 Jan 2009 05:50:19 +0000</pubDate>
		<dc:creator>Chris Black</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Button]]></category>
		<category><![CDATA[Cascading Styles]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Descendant Selectors]]></category>
		<category><![CDATA[Dimensioning]]></category>
		<category><![CDATA[Myth]]></category>
		<category><![CDATA[Skinning]]></category>

		<guid isPermaLink="false">http://www.blackcj.com/blog/?p=146</guid>
		<description><![CDATA[This will be a three part series on skinning Flex components. For part one I have chosen to desolve the myth that Flex 3 can't truly cascade styles. This three part series will start simple and get more complex with each post. You can use this code to mimic descendant selectors, dimensioning and multiple class [...]]]></description>
			<content:encoded><![CDATA[<p>This will be a three part series on skinning Flex components.  For part one I have chosen to desolve the myth that Flex 3 can't truly cascade styles.  This three part series will start simple and get more complex with each post.  You can use this code to mimic descendant selectors, dimensioning and multiple class names within Flex.</p>
<p>Problem:<br />
Flex can't do true cascading styles like HTML (for example a black play button)</p>
<p>Solution:<br />
YES, flex can do cascading styles.  It just requires a different approach.  A programmatic approach.  Don't worry, I assure you that even a non-programmer can pick this one up.  </p>
<p>Lets dive a little deeper.  Cascading styles refers to the ability to start with a button, style it into a black button then go a step further and make it a play button.  First, create a button and use some CSS to style various properties of that button.</p>
<div class="igBar"><span id="lhtml-10"><a href="#" onclick="javascript:showPlainTxt('html-10'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-10">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;</span></a>?xml <span style="color: #000066;">version</span>=<span style="color: #ff0000;">"1.0"</span> encoding=<span style="color: #ff0000;">"utf-8"</span>?<span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;">&lt;mx:Application xmlns:mx=<span style="color: #ff0000;">"http://www.adobe.com/2006/mxml"</span> layout=<span style="color: #ff0000;">"absolute"</span> xmlns:<span style="color: #000066;">text</span>=<span style="color: #ff0000;">"flash.text.*"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;">&lt;mx:<span style="color: #000066;">Style</span> source=<span style="color: #ff0000;">"css/styles.css"</span> /<span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;">&lt;mx:Button <span style="color: #000066;">label</span>=<span style="color: #ff0000;">"Click Me"</span>/<span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;</span></a>/mx:Application&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<div class="igBar"><span id="lcss-11"><a href="#" onclick="javascript:showPlainTxt('css-11'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-11">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Button <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; cornerRadius: <span style="color: #cc66cc;color:#800000;">12</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; fontSize: <span style="color: #cc66cc;color:#800000;">15</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Simple enough, right?</p>
<p>Next we want a black button:</p>
<div class="igBar"><span id="lactionscript-12"><a href="#" onclick="javascript:showPlainTxt('actionscript-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-12">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">package com.<span style="color: #006600;">cb</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">controls</span>.<span style="color: #0066CC;">Button</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> BlackButton <span style="color: #0066CC;">extends</span> <span style="color: #0066CC;">Button</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> BlackButton<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">super</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>There it is.  All the actionscript you will need.  And to think it was all auto generated!  </p>
<div id="attachment_148" class="wp-caption aligncenter" style="width: 197px"><a href="http://www.blackcj.com/blog/wp-content/uploads/2009/01/actionscript-class.jpg"><img src="http://www.blackcj.com/blog/wp-content/uploads/2009/01/actionscript-class-187x300.jpg" alt="Actionscript Class Generation" title="Actionscript Class Generation" width="187" height="300" class="size-medium wp-image-148" /></a><p class="wp-caption-text">Actionscript Class Generation</p></div>
<p>Add the MXML and CSS:</p>
<div class="igBar"><span id="lhtml-13"><a href="#" onclick="javascript:showPlainTxt('html-13'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-13">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">...</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/button.html"><span style="color: #000000; font-weight: bold;">&lt;button</span></a>:BlackButton <span style="color: #000066;">label</span>=<span style="color: #ff0000;">"Click Me"</span> /<span style="color: #000000; font-weight: bold;">&gt;</span></a></span>&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">... </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<div class="igBar"><span id="lcss-14"><a href="#" onclick="javascript:showPlainTxt('css-14'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-14">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">BlackButton <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; fillAlphas: <span style="color: #cc66cc;color:#800000;">1</span>.<span style="color: #cc66cc;color:#800000;">0</span>, <span style="color: #cc66cc;color:#800000;">1</span>.<span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; fillColors: #000000, #000000;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">color</span>: #FFFFFF;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Now we have a black button.  This process can be used as many times as you want to continually inherit properties from another object.  You could have a small, blue button with red text all styled at each level.</p>
<p>Lastly, we need to add the play icon:</p>
<div class="igBar"><span id="lhtml-15"><a href="#" onclick="javascript:showPlainTxt('html-15'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-15">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">...</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/button.html"><span style="color: #000000; font-weight: bold;">&lt;button</span></a>:BlackButton <span style="color: #000066;">label</span>=<span style="color: #ff0000;">"Click Me"</span> styleName=<span style="color: #ff0000;">"playButton"</span> /<span style="color: #000000; font-weight: bold;">&gt;</span></a></span>&nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">... </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<div class="igBar"><span id="lcss-16"><a href="#" onclick="javascript:showPlainTxt('css-16'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-16">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #6666ff;">.playButton </span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; <span style="color: #993333;">icon</span>: Embed<span style="color: #66cc66;">&#40;</span>source=<span style="color: #ff0000;">'assets/play.png'</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Now we have a black play button.  Add a stop, pause, and mute button as BlackButton's and they will all be updated when you modify the style for either the base Button class or the BlackButton class.  Again, this tutorial is not very technical but the next two will be.  This is meant to be the first step in bridging the gap between design and actionscript using Flex 3.</p>
<p>The number of comments I get on this post will exponentially increase the likelihood of part 2 coming out sooner <img src='http://www.blackcj.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://www.blackcj.com/CascadingStylesForFlex/"><br />
Sample</a></p>
<p><a href="http://www.blackcj.com/CascadingStylesForFlex/srcview/index.html">Source View</a></p>
<p><br/><br />
References:</p>
<p><a href="http://www.barneyb.com/barneyblog/2007/06/13/the-woes-of-flex/">The Woes of Flex</a></p>
<p><a href="http://www.stevekwan.com/archives/2008/02/734">CSS in Flex is not real CSS at all</a></p>
<p><a href="https://bugs.adobe.com/jira/browse/SDK-14385">Adobe Bug Page</a></p>
<p><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.blackcj.com/blog/2009/01/06/skinning-flex-components-part-1-css/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.785 seconds -->

