<?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>Flexpert to the rescue &#187; workflow</title>
	<atom:link href="http://www.flexpert.be/tag/workflow/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.flexpert.be</link>
	<description>Blog site about all things Adobe</description>
	<lastBuildDate>Sun, 05 Feb 2012 21:58:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Creating Flex themes with Flash Catalyst</title>
		<link>http://www.flexpert.be/2011/04/creating-flex-themes-with-flash-catalyst/</link>
		<comments>http://www.flexpert.be/2011/04/creating-flex-themes-with-flash-catalyst/#comments</comments>
		<pubDate>Sun, 03 Apr 2011 09:37:52 +0000</pubDate>
		<dc:creator>Steven Peeters</dc:creator>
				<category><![CDATA[Flash Builder]]></category>
		<category><![CDATA[Flash Catalyst]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[themes]]></category>
		<category><![CDATA[workflow]]></category>

		<guid isPermaLink="false">http://www.flexpert.be/?p=803</guid>
		<description><![CDATA[In my book Flash Builder and Flash Catalyst; the new workflow I talk about different workflows for the different types of applications. These workflows are all good when creating a single application. But isn&#8217;t there something you could do for improving reusability of your design elements and collaborating more easily? [...]]]></description>
			<content:encoded><![CDATA[<p>In my book <a href="http://amzn.to/hb3RBm">Flash Builder and Flash Catalyst; the new workflow</a> I talk about different workflows for the different types of applications. These workflows are all good when creating a single application. But isn&#8217;t there something you could do for improving reusability of your design elements and collaborating more easily?</p>
<p>First thing to do, and this is what I always tend to do, is to <strong>export your Flash Catalyst components as a Flex library project</strong>. This allows you to get around the roundtripping issue, because this library project only contains Flash Catalyst generated components and will therefore remain compatible with Flash Catalyst when you need to alter the design at some point in the future.</p>
<p>Skinning your actual project is then done by linking the SWC file from the library project to your actual project and applying the proper skin to the component using the skinClass property. Now to be able to work with this properly, you&#8217;ll need to <strong>create a manifest file for that library</strong> as well. This will allow you to use only one single namespace for every component/skin in the library, even though the components/skins may reside in a number of packages.</p>
<p>Now, this approach will definitely work, but you still have to apply the <em>skinClass</em> property to every component in your application. However, <strong>you can apply all the styling on your application by defining a theme CSS that accompanies the SWC file containing the skins</strong>. Let me briefly explain this process by creating a very small example.</p>
<p>In this example I&#8217;m going to create a skin for a single component, namely the <em>HSlider</em> component. I want to make it look a little bit like the iOS slider, where you have a colored fill of the slider bar that follows the slider thumb position. To make things easier, I&#8217;m going to start out in Flash Catalyst. I simply create a new project with the default settings and I&#8217;m going to create the skin from scratch. Of course, you can certainly start out with an Illustrator or a Photoshop file. The process of creating the skin will remain exactly the same.</p>
<p>First I need to create the track and duplicate that layer to have the fill color as a separate item. Next, I&#8217;m creating the thumb for the slider by drawing two concentric circles with opposite gradients, one a little smaller than the other, to create a semi 3D lighting effect. The result looks like the image below.</p>
<p><a href="http://www.flexpert.be/wp-content/Layers-panel.png"><img src="http://www.flexpert.be/wp-content/Layers-panel-300x111.png" alt="" title="iOS Slider design" width="300" height="111" class="aligncenter size-medium wp-image-810" /></a></p>
<p>The next step is to convert that design into a working component. Now, in Flash Catalyst, unless you&#8217;re putting components on the artboard, you actually just create some skin files. So, using the Heads-Up Display (HUD) I convert the artwork into a horizontal slider. After indicating the track and thumb, my skin file is now ready to be imported into Flash Builder.</p>
<p>Since I&#8217;m going to be creating a Flex theme, I don&#8217;t just save the Flash Catalyst project and open it in Flash Builder. I&#8217;m actually going to <strong>export the library components as a Flex library project (FXPL)</strong>, as shown below. When you import the FXPL file into Flash Builder it will automatically create the library project for you.</p>
<p><a href="http://www.flexpert.be/wp-content/Library-panel.png"><img src="http://www.flexpert.be/wp-content/Library-panel.png" alt="" title="Library panel" width="284" height="236" class="aligncenter size-full wp-image-816" /></a></p>
<p>If you look at the code now, you&#8217;ll see that the size of the slider skin is fixed. But <strong>since I want to create a theme that can be used in any circumstance and in any project, I need to make a few adjustments to the generated code to make the skin more dynamic</strong>. For that I&#8217;m going to make use of the <em>[HostComponent]</em> metadata tag. This gives me a reference to the actual component that this skin is applied to. Therefore I can get the size of that component and adjust the skin accordingly. The adjusted code for the main HSlider skin looks like this.</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Skin</span> xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">		xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">		width=<span style="color: #ff0000;">&quot;300&quot;</span> height=<span style="color: #ff0000;">&quot;17&quot;</span><span style="color: #7400FF;">&gt;</span></span>
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Metadata</span><span style="color: #7400FF;">&gt;</span></span>[HostComponent(&quot;spark.components.HSlider&quot;)]<span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Metadata</span><span style="color: #7400FF;">&gt;</span></span>
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:states</span><span style="color: #7400FF;">&gt;</span></span>
		<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:State</span> name=<span style="color: #ff0000;">&quot;normal&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
		<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:State</span> name=<span style="color: #ff0000;">&quot;disabled&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:states</span><span style="color: #7400FF;">&gt;</span></span>
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;track&quot;</span> x=<span style="color: #ff0000;">&quot;0&quot;</span> y=<span style="color: #ff0000;">&quot;5&quot;</span> skinClass=<span style="color: #ff0000;">&quot;components.IOSSliderTrackSkin&quot;</span> width=<span style="color: #ff0000;">&quot;{hostComponent.width}&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> x=<span style="color: #ff0000;">&quot;1&quot;</span> y=<span style="color: #ff0000;">&quot;6&quot;</span> width=<span style="color: #ff0000;">&quot;{thumb.x + (thumb.width / 2)}&quot;</span> height=<span style="color: #ff0000;">&quot;6&quot;</span> radiusX=<span style="color: #ff0000;">&quot;10&quot;</span><span style="color: #7400FF;">&gt;</span></span>
		<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
			<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:LinearGradient</span> rotation=<span style="color: #ff0000;">&quot;90&quot;</span><span style="color: #7400FF;">&gt;</span></span>
				<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:GradientEntry</span> alpha=<span style="color: #ff0000;">&quot;1.0&quot;</span> color=<span style="color: #ff0000;">&quot;#009CFF&quot;</span> ratio=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
				<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:GradientEntry</span> alpha=<span style="color: #ff0000;">&quot;1.0&quot;</span> color=<span style="color: #ff0000;">&quot;#002FD1&quot;</span> ratio=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
			<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:LinearGradient</span><span style="color: #7400FF;">&gt;</span></span>
		<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;thumb&quot;</span> x=<span style="color: #ff0000;">&quot;134&quot;</span> y=<span style="color: #ff0000;">&quot;0&quot;</span> skinClass=<span style="color: #ff0000;">&quot;components.IOSSliderThumbSkin&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Skin</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>You&#8217;ll notice that I&#8217;ve bound the colored rectangle&#8217;s size to the position of the center point of the thumb. This will assure that the colored section follows the slider thumb position instead of being static and covering the whole component.<br />
Now, the default size for the slider is 300 pixels, but if you specify another width, the component will be resized properly. I didn&#8217;t take the height into account for this simple demo, but similarly you can also adjust the height of the component according to the height specified in the application.</p>
<p><strong>Next thing to do is to create a CSS file that attaches this skin to all HSlider components.</strong> This is very simple and straightforward, as you can see in the code below.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* CSS file */</span>
<span style="color: #a1a100;">@namespace s &quot;library://ns.adobe.com/flex/spark&quot;;</span>
<span style="color: #a1a100;">@namespace fc &quot;http://ns.adobe.com/flashcatalyst/2009&quot;;</span>
&nbsp;
s|HSlider <span style="color: #00AA00;">&#123;</span>
	skinClass<span style="color: #00AA00;">:</span> ClassReference<span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;components.IOSSlider&quot;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>OK, so now our theme is ready to be used. There are a couple more steps to take before you an actually use it. First of all, you need to <strong>compile the library project</strong>, so you can link it to the actual project that you are going to apply the theme to. Since I&#8217;m using Flash Builder with automatic builds, this is already taken care of.</p>
<p>The next step is to load the CSS file into the theme selector, so you can actually apply the theme to the project using a few very simple clicks. For that, I&#8217;m going to the Design view in my project and click on the <em>Current Theme</em> link in the <em>Appearance</em> panel. This brings up the theme selector dialog.</p>
<p><a href="http://www.flexpert.be/wp-content/Import-theme.png"><img src="http://www.flexpert.be/wp-content/Import-theme-300x187.png" alt="" title="Import theme" width="300" height="187" class="aligncenter size-medium wp-image-823" /></a></p>
<p>In that dialog I&#8217;m importing the new theme by selecting the CSS file that I&#8217;ve just created and giving it a proper name. Since I&#8217;m going for an iOS look, I&#8217;ve simply named it <em>iOS</em>. Now, after the import, you can see the new theme displayed in the list of themes to choose from. So, obviously I choose that theme and click <em>OK</em>.</p>
<p><a href="http://www.flexpert.be/wp-content/Apply-theme.png"><img src="http://www.flexpert.be/wp-content/Apply-theme-300x181.png" alt="" title="Apply theme" width="300" height="181" class="aligncenter size-medium wp-image-825" /></a></p>
<p>Now that I have the new theme applied to the project, I can simply use a <em>HSlider</em> component in my application and it will automatically be styled according to the settings in the them. To prove that the theme is dynamically adjustable, I&#8217;m creating a component with a <em>width</em> property of 500 pixels.</p>
<p>If you compile the application now, you would get some errors, because the skin files cannot be found. <strong>The very last thing I need to do is to link the theme&#8217;s SWC file to my project.</strong> In this example I&#8217;ve just copied the SWC file to the <em>libs</em> folder in my project. However, you could create a RSL (Runtime Shared Library) even to have your theme deployed separately and only once for all your projects. The big advantage is that your resulting project SWF file doesn&#8217;t get affected by the theme and when you alter your theme, you can just deploy that RSL and every project that uses that theme will automatically be updated next time it is started up.</p>
<p>The result is a working slider bar that has dynamic content and is styled via a Flex theme inside of Flash Builder. Just try out the example below to see the result.</p>
<p><center>
<object width="550" height="50">
<param name="movie" value="http://www.flexpert.be/swfexamples/iOSTest.swf"></param>
<param name="quality" value="high"></param>
<param name="wmode" value="window"></param>
<param name="menu" value="false"></param>
<param name="bgcolor" value="#FFFFFF"></param>
<param name="allowScriptAccess" value="always"></param>
<embed wmode="transparent" type="application/x-shockwave-flash" width="550" height="50" src="http://www.flexpert.be/swfexamples/iOSTest.swf" quality="high" bgcolor="#FFFFFF" wmode="window" menu="false" ></embed>
</object>
</center></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flexpert.be/2011/04/creating-flex-themes-with-flash-catalyst/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Pre-order my book</title>
		<link>http://www.flexpert.be/2009/12/pre-order-my-book/</link>
		<comments>http://www.flexpert.be/2009/12/pre-order-my-book/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 13:33:36 +0000</pubDate>
		<dc:creator>Steven Peeters</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flash Builder]]></category>
		<category><![CDATA[Flash Catalyst]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[best practices]]></category>
		<category><![CDATA[book]]></category>
		<category><![CDATA[Flex 4]]></category>
		<category><![CDATA[workflow]]></category>

		<guid isPermaLink="false">http://www.flexpert.be/?p=323</guid>
		<description><![CDATA[Hey guys, I know it has been rather quiet on my site lately. The reason for this is the fact that I&#8217;m currently writing a book. Now, what is it going to be about? Some of you may know this already by reading my Twitter posts or by following my [...]]]></description>
			<content:encoded><![CDATA[<div style="float:right;margin-left:20px;margin-top:30px">
<a href="http://www.amazon.com/Flash-Builder-Catalyst-Workflow-Essential/dp/1430228350/ref=sr_1_1?ie=UTF8&#038;s=books&#038;qid=1260451049&#038;sr=8-1" target="_blank"><img src="http://flexpert.be/images/book.jpg"></a>
</div>
<p style="display:block">Hey guys,</p>
<p>I know it has been rather quiet on my site lately. The reason for this is the fact that I&#8217;m currently writing a <a href="http://www.friendsofed.com/book.html?isbn=1430228350" target="_blank">book</a>. Now, what is it going to be about? Some of you may know this already by reading my Twitter posts or by following my LinkedIn status messages. For the others, I can say for now that it is about Flash Builder and Flash Catalyst and how those products are going to change the way you work on Flex projects as a developer. As a designer (or interaction designer) you are going to be more closely involved in creating and maintaining Flex 4 applications when using these products.</p>
<p>So, basically, it is not going to be a manual about Flash Builder, nor is it a manual about Flash Catalyst. But it is a guideline with general best practices and designer-developer workflow situations, explained in a very practical way.</p>
<p>You can now already pre-order the book on Amazon.com or by clicking on the cover image.  Don&#8217;t mind the cover image for now. This is just a preliminary image, which will change by the time it is going to be released. The release date should be somewhere around April 2010.</p>
<p>Hopefully, you&#8217;ll like it&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flexpert.be/2009/12/pre-order-my-book/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

