<?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>Blog of Ruy Adorno &#187; Flex4</title>
	<atom:link href="http://blog.ruyadorno.com/category/flex4/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ruyadorno.com</link>
	<description>Flash, Actionscript, Haxe, Flex and more</description>
	<lastBuildDate>Sun, 11 Apr 2010 04:04:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>States transition in Flex4</title>
		<link>http://blog.ruyadorno.com/2009/08/states-transition-in-flex4/</link>
		<comments>http://blog.ruyadorno.com/2009/08/states-transition-in-flex4/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 20:29:45 +0000</pubDate>
		<dc:creator>Ruy Adorno</dc:creator>
				<category><![CDATA[Flex4]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[catalyst]]></category>
		<category><![CDATA[flash builder]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[state]]></category>
		<category><![CDATA[states]]></category>
		<category><![CDATA[transition]]></category>

		<guid isPermaLink="false">http://blog.ruyadorno.com/?p=14</guid>
		<description><![CDATA[The flex4 framework comes with a new and so much easier way to create transition between the states of your components. In this small tutorial I'll explain the basic use of it.]]></description>
			<content:encoded><![CDATA[<p>The flex4 framework comes with a new and so much easier way to create transition between the states of your components. I think this is primarily developed to support all the features needed in the new  Adobe Flash Catalyst product, but it does a great job for developers too.<br />
I created this little tutorial to demonstrate the using of this new feature in Flex4, first of all create a new project inside FlashBuilder. The following code will be auto generated in the main mxml file of the project, if you don&#8217;t have FlashBuilder just copy the code and paste using the IDE of your choice. Remember that you&#8217;ll need the Flex 4 SDK.</p>
<pre>
<code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;s:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/halo"
minWidth="1024" minHeight="768"&gt;

&lt;/s:Application&gt;</code>
</pre>
<p>First of all we&#8217;ll add our states declaration, pretty much the same thing it was on Flex3:</p>
<pre>
<code>&lt;s:states&gt;
	&lt;s:State name="initialState" /&gt;
	&lt;s:State name="readyState" /&gt;
&lt;/s:states&gt;</code>
</pre>
<p>Now let&#8217;s add something to test our animation, I&#8217;ll just add a Button to switch between states and a SimpleText tag using the new syntax for transitions changing.</p>
<pre>
<code>&lt;s:SimpleText id="simpleText" x="20" y="50" text="Hello World!" fontSize="54"
		alpha.initialState="0" alpha.readyState="1"  /&gt;
	&lt;s:Button id="button" x="110" y="130" label="Press me to fade"
	click="{currentState = (currentState=='initialState')?'readyState':'initialState'}"/&gt;</code>
</pre>
<p>And finally we&#8217;ll add the transitions tag, that will specify to flex framework which transition animation should be used when changing our states.</p>
<pre>
<code>&lt;s:transitions&gt;
	&lt;s:Transition&gt;
		&lt;s:Parallel target="{simpleText}"&gt;
			&lt;s:Fade duration="1000" /&gt;
		&lt;/s:Parallel&gt;
	&lt;/s:Transition&gt;
&lt;/s:transitions&gt;</code>
</pre>
<p>And it&#8217;s ready! You can compile and see how magic is our transition between states now, you can also check it below, click on the button to perform the transition:</p>
<p>
<object width="330" height="200">
<param name="movie" value="http://blog.ruyadorno.com/wp-content/uploads/2009/08/Main.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>
<embed type="application/x-shockwave-flash" width="330" height="200" src="http://blog.ruyadorno.com/wp-content/uploads/2009/08/Main.swf" quality="high" bgcolor="#FFFFFF" wmode="window" menu="false" ></embed>
</object>
</p>
<p>Below you can check the full code for this, you&#8217;ll need the Flex 4 SDK in order to compile it.</p>
<pre>
<code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;s:Application
	xmlns:fx="http://ns.adobe.com/mxml/2009"
	xmlns:s="library://ns.adobe.com/flex/spark"
	xmlns:mx="library://ns.adobe.com/flex/halo"
	minWidth="300" minHeight="200"&gt;

	&lt;s:states&gt;
		&lt;s:State name="initialState"/&gt;
		&lt;s:State name="readyState"/&gt;
	&lt;/s:states&gt;

	&lt;s:transitions&gt;
		&lt;s:Transition&gt;
			&lt;s:Parallel target="{simpleText}"&gt;
				&lt;s:Fade duration="1000" /&gt;
			&lt;/s:Parallel&gt;
		&lt;/s:Transition&gt;
	&lt;/s:transitions&gt;

	&lt;s:SimpleText id="simpleText" x="20" y="50" text="Hello World!" fontSize="54"
		alpha.initialState="0" alpha.readyState="1"  /&gt;
	&lt;s:Button id="button" x="110" y="130" label="Press me to fade"
	click="{currentState = (currentState=='initialState')?'readyState':'initialState'}"/&gt;

&lt;/s:Application&gt;</code>
</pre>
<p>It&#8217;s just a too simple example, but it serves well to explain the utilization of the new states transition scheme, from here you can create any type of animations, moving the items, 3d animations and more.<br />
This type of animation is very useful when dealing with sections changing and other states changes. Is up to you to try and make a good use of it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ruyadorno.com/2009/08/states-transition-in-flex4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>First impressions of Flex4</title>
		<link>http://blog.ruyadorno.com/2009/08/first-impressions-of-flex4/</link>
		<comments>http://blog.ruyadorno.com/2009/08/first-impressions-of-flex4/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 03:26:49 +0000</pubDate>
		<dc:creator>Ruy Adorno</dc:creator>
				<category><![CDATA[Flex4]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[catalyst]]></category>
		<category><![CDATA[flash builder]]></category>
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://blog.ruyadorno.com/?p=11</guid>
		<description><![CDATA[It have been one month since the Flash Builder and Flash Catalyst betas was released to the main public, I had the opportunity to get both of them and here is some of my impressions about this great news.]]></description>
			<content:encoded><![CDATA[<p>It have been one month since the Flash Builder and Flash Catalyst betas was released to the main public, I had the opportunity to get both of them and even to start using it in some real projects at work.</p>
<p>Flash Catalyst still having the same impression we had from the Thermo days, it seems a great tool, have a lot of potential, but we need to see it ready to know how well it will perform in some real projects in the real world.<br />
By now the whole tool is too rough yet and is looking much more like just an intermediate tool to help the transition between designer-programmer, the main problem is that it&#8217;s not looking like a designer friendly application and this is a key point for the future success of the product. Maybe I&#8217;m just hopeful that we can take some work from the hands of overloaded programmers and give designers a new and important role in the production phase.</p>
<p>On the other hand I had the new Flash Builder that is essentially an improved version of Flex Builder 3. There are some nice new features, but it still the same application and I think that it does the job for this actualization, mainly because the great star of this release is the new spark components architecture, it has a new and so much easier skinning system and many other features that I hope to show in the future posts of this blog.</p>
<p>In my opinion the new Flex4 platform emerges as a new and nice solution for the future of web projects, it&#8217;s essential to every Flash/Flex coder get to know it and let&#8217;s see where it will lead us to.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ruyadorno.com/2009/08/first-impressions-of-flex4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
