<?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>Jacob Wright - Flex, AIR, PHP, etc. &#187; Flex</title>
	<atom:link href="http://jacwright.com/blog/category/flex/feed/" rel="self" type="application/rss+xml" />
	<link>http://jacwright.com/blog</link>
	<description>Flex, AIR, PHP, etc.</description>
	<lastBuildDate>Thu, 29 Jul 2010 15:05:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Flex Styling without the Flex (example and source)</title>
		<link>http://jacwright.com/blog/295/flex-styling-without-the-flex/</link>
		<comments>http://jacwright.com/blog/295/flex-styling-without-the-flex/#comments</comments>
		<pubDate>Mon, 31 Aug 2009 16:48:25 +0000</pubDate>
		<dc:creator>Jacob Wright</dc:creator>
				<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://jacwright.com/blog/?p=295</guid>
		<description><![CDATA[Question: What&#8217;s 2.8KB, can style any DisplayObject on the stage, and enjoys long walks on the beach? Answer: Flex styling pwned! So it&#8217;s leaked out on twitter that Ben Stucki, Ryan Campbell, Tyler Wright, and myself are working together on a new RIA component initiative. Taking a different approach than Open Flux, we are starting [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Question:</strong> What&#8217;s 2.8KB, can style any DisplayObject on the stage, and enjoys long walks on the beach?</p>
<p><strong>Answer:</strong> Flex styling pwned!</p>
<p>So it&#8217;s leaked out on twitter that <a href="http://www.benstucki.net">Ben Stucki</a>, <a href="http://www.bobjim.com/">Ryan Campbell</a>, <a href="http://xtyler.com/">Tyler Wright</a>, and myself are working together on a new RIA component initiative. Taking a different approach than Open Flux, we are starting from scratch and building up fresh. We&#8217;re bringing together what we&#8217;ve learned from Open Flux and Stealth with the goal to release finished features and stable builds. We hope to provide something that we all can use in production. We haven&#8217;t announced the name yet, officially.</p>
<p>Ryan posted about <a href="http://www.bobjim.com/2009/08/26/using-mxml-without-flex-example-and-source/">using MXML without Flex</a> last week. Though it isn&#8217;t for the new framework, the principle can be used for that framework. Maybe someday styling could be too. Today, I&#8217;m posting about using Flex styling without the Flex framework. I&#8217;ve taken the same example that Ryan posted and embellished. The components in there are Explanation of what is styled after the example.</p>
<p><iframe width="100%" height="150" src="/blog/resources/no-flex-styling/"></iframe></p>
<p>Here&#8217;s the new MinimalComps.mxml source:</p>
<p><iframe width="100%" height="620" src="/blog/resources/no-flex-styling/srcview/source/MinimalComps.mxml.html"></iframe></p>
<p>And the styles.css source:</p>
<p><iframe width="100%" height="350" src="/blog/resources/no-flex-styling/srcview/source/styles.css.html"></iframe></p>
<p>The example looks very similar to Ryan&#8217;s, but notice differences including:</p>
<ul>
<li>the PushButton label is set from the stylesheet</li>
<li>x, y, and spacing are no longer in the MXML on the VBox, they are only in the stylesheet</li>
<li>Descendent selectors work</li>
<li>#id can match the name property of DisplayObject</li>
<li>There is no styling code built into the components. This styling is not intrusive and can work with any display objects.</li>
<li>If you were to extend the IStylable interface provided, then you could also match against .stylenames and :pseudo selectors for state.</li>
</ul>
<h3>Pros and Cons</h3>
<p>In order to accomplish this, I had to provide the mx.style.* classes that a stylesheet expects to be there when it is loaded. That means you cannot use this approach along with Flex, only in place of Flex. We could get it to work in a sub-applicationDomain, but that is more work and this is only a proof-of-concept.</p>
<p>This may actually be considered more of a IoC framework than styling. We do not have getStyle/setStyle on the components and anything (any public property that is) can be set from the stylesheet, not just stylable properties. That may be considered a con to styling purists, or a pro to those who have wanted to set whatever they want.</p>
<p><a href="/blog/resources/no-flex-styling/srcview/">View</a> or <a href="/blog/resources/no-flex-styling/srcview/MinimalComps.zip">Download</a> the source code.</p>
<p><strong>Update:</strong> Oh, I forgot a couple pros and cons.<br />
Pro: Using Flex styling for non-flex projects allows you to embed assets and class references into the stylesheet. Something you can&#8217;t do with traditional text-only styling. It allows a stylesheet full of skin classes to be overridden with another stylesheet full of skin classes for theming.<br />
Con: It only supports CSS up to what Flex 4 does. That means only descendent selectors, no child selectors, sibling selectors, attribute selectors, etc. because MXMLC just ignores those rules it doesn&#8217;t understand.</p>
]]></content:encoded>
			<wfw:commentRss>http://jacwright.com/blog/295/flex-styling-without-the-flex/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>High quality, high performance thumbnails in Flash</title>
		<link>http://jacwright.com/blog/221/high-quality-high-performance-thumbnails-in-flash/</link>
		<comments>http://jacwright.com/blog/221/high-quality-high-performance-thumbnails-in-flash/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 19:37:03 +0000</pubDate>
		<dc:creator>Jacob Wright</dc:creator>
				<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://jacwright.com/blog/?p=221</guid>
		<description><![CDATA[Ever need a thumbnail of an image in Flash? I do, and honestly speaking, the resampling that Flash does is less than ideal. Unless you only need to resize by half or bigger. But my thumbnails usually need to be smaller. I searched for a solution and found on voq.com a promising library with some [...]]]></description>
			<content:encoded><![CDATA[<p>Ever need a thumbnail of an image in Flash? I do, and honestly speaking, the resampling that Flash does is less than ideal. Unless you only need to resize by half or bigger. But my thumbnails usually need to be smaller.</p>
<p>I searched for a solution and found on voq.com a <a href="http://blog.voq.jp/2007/12/creating_high_quality_thumnail.html">promising library</a> with some algorithms that worked quite nicely and a demo. The quality was nice, but the speed was slow. It also fiddled with the color a little bit. If I put the "easyScaling" parameter down from .5 to .25 I ended up with a nicer thumbnail but was slower to make and had more color disfiguration. You could tell what the original piece was better though.</p>
<p>After some more searching I found that <a href="http://www.brooksandrus.com/blog/2009/03/11/bilinear-resampling-with-flash-player-and-pixel-bender/">Brooks Andrus played with some algorithms using Pixel Bender</a>. The conclusion to that was he found he could do the same thing with the "smoothing" option in the BitmapData.draw() method. And this still leaves me with yucky thumbnails at small sizes.</p>
<p>I began thinking I would need to take the algorithms from the first source and port them into pixel bender like Brooks did for his ThumbGenie application.</p>
<p>I thought I'd try one more option first. I had played around in my mind with the idea of resizing a bitmap in half, then in half again, until I reached my destination size, since resizing by half still had good results. After discussing it with Tyler I tried it out and ended up with some great results. That last resize to get to the final thumbnail size wasn't half because in an imperfect world your thumbnails aren't always a power of two times smaller than your original. So I had an odd-man-out scale at the end I was applying. Tyler suggested I put that odd-man-out scale at the first instead. So instead of:</p>
<p>1000x750 * .5 resize * .5 resize * .5 resize * .8 = 100x75</p>
<p>It worked like this:</p>
<p>1000x750 * .8 resize * .5 resize * .5 resize * .5 = 100x75</p>
<p>Doing it that way landed me with even better results! It seems that Flash does it's best work when resizing by exactly 1/2.</p>
<p><img src="http://jacwright.com/blog/wp-content/uploads/2009/07/Thumbnailing-Results.png" alt="Thumbnail tests" /></p>
<p>The above image shows my test results as follows taking a snapshot of my homepage in an HTMLLoader in AIR.</p>
<ol>
<li>Regular BitmapData.draw() method without smoothing (0 miliseconds)</li>
<li>Regular BitmapData.draw() method <strong>with</strong> smoothing (1 miliseconds)</li>
<li>Using my own method that resizes by the odd scale first, then by halves (8 milliseconds)</li>
<li>Using my method but after the odd scale, only scaling down by quarters (33 miliseconds)</li>
<li>Using the voq Lanczos3 method with easyScaling at .25 and sharpening (694 miliseconds)</li>
<li>Using the voq Lanczos3 method with easyScaling at .25 and no sharping (676 miliseconds)</li>
<li>Using the voq Triangle method with easyScaling at .25 and sharpening (275 miliseconds)</li>
<li>Using the voq Triangle method with easyScaling at .25 and no sharpening (266 miliseconds)</li>
</ol>
<p>My personal opinion is that the best looking thumb is #3. I was surprised that #4 wouldn't be as good. I knew the performance would be lower because I was doing more iterations of BitmapData.draw(), but I thought that scaling it to 75% (down a quarter) each time would end up nicer. Looks like 50% is the best scale to use.</p>
<p>The voq.com algos looked pretty decent, but obviously were slow. I'm quite happy with the solution I've found. I only had to write a little bit of code, it's fast enough, and looks better than any other solution I've found (even Fireworks resizing IMO).</p>
<p>Here is the method I wrote for this. Note, when scaling up, it seemed to look better to just use smoothing and do it in one draw() and not iterations of 2.</p>
<div class="syntax_hilite">
<div id="actionscript-2">
<div class="actionscript"><span style="color: #0066CC;">private</span> <span style="color: #0066CC;">static</span> const IDEAL_RESIZE_PERCENT:<span style="color: #0066CC;">Number</span> = .<span style="color: #cc66cc;">5</span>;</p>
<p><span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> <span style="color: #000000; font-weight: bold;">function</span> resizeImage<span style="color: #66cc66;">&#40;</span>source:BitmapData, <span style="color: #0066CC;">width</span>:uint, <span style="color: #0066CC;">height</span>:uint, constrainProportions:<span style="color: #0066CC;">Boolean</span> = <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>:BitmapData<br />
<span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> scaleX:<span style="color: #0066CC;">Number</span> = <span style="color: #0066CC;">width</span>/source.<span style="color: #0066CC;">width</span>;<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> scaleY:<span style="color: #0066CC;">Number</span> = <span style="color: #0066CC;">height</span>/source.<span style="color: #0066CC;">height</span>;<br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>constrainProportions<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>scaleX&gt; scaleY<span style="color: #66cc66;">&#41;</span> scaleX = scaleY;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span> scaleY = scaleX;<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> bitmapData:BitmapData = source;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>scaleX&gt;= <span style="color: #cc66cc;">1</span> &amp;&amp; scaleY&gt;= <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; bitmapData = <span style="color: #000000; font-weight: bold;">new</span> BitmapData<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">ceil</span><span style="color: #66cc66;">&#40;</span>source.<span style="color: #0066CC;">width</span>*scaleX<span style="color: #66cc66;">&#41;</span>, <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">ceil</span><span style="color: #66cc66;">&#40;</span>source.<span style="color: #0066CC;">height</span>*scaleY<span style="color: #66cc66;">&#41;</span>, <span style="color: #000000; font-weight: bold;">true</span>, <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; bitmapData.<span style="color: #006600;">draw</span><span style="color: #66cc66;">&#40;</span>source, <span style="color: #000000; font-weight: bold;">new</span> Matrix<span style="color: #66cc66;">&#40;</span>scaleX, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span>, scaleY<span style="color: #66cc66;">&#41;</span>, <span style="color: #000000; font-weight: bold;">null</span>, <span style="color: #000000; font-weight: bold;">null</span>, <span style="color: #000000; font-weight: bold;">null</span>, <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> bitmapData;<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// scale it by the IDEAL for best quality</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> nextScaleX:<span style="color: #0066CC;">Number</span> = scaleX;<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> nextScaleY:<span style="color: #0066CC;">Number</span> = scaleY;<br />
&nbsp; &nbsp; <span style="color: #b1b100;">while</span> <span style="color: #66cc66;">&#40;</span>nextScaleX &lt;<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> nextScaleX /= IDEAL_RESIZE_PERCENT;<br />
&nbsp; &nbsp; <span style="color: #b1b100;">while</span> <span style="color: #66cc66;">&#40;</span>nextScaleY &lt;<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> nextScaleY /= IDEAL_RESIZE_PERCENT;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>scaleX &lt;IDEAL_RESIZE_PERCENT<span style="color: #66cc66;">&#41;</span> nextScaleX *= IDEAL_RESIZE_PERCENT;<br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>scaleY &lt;IDEAL_RESIZE_PERCENT<span style="color: #66cc66;">&#41;</span> nextScaleY *= IDEAL_RESIZE_PERCENT;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> temp:BitmapData = <span style="color: #000000; font-weight: bold;">new</span> BitmapData<span style="color: #66cc66;">&#40;</span>bitmapData.<span style="color: #0066CC;">width</span>*nextScaleX, bitmapData.<span style="color: #0066CC;">height</span>*nextScaleY, <span style="color: #000000; font-weight: bold;">true</span>, <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; temp.<span style="color: #006600;">draw</span><span style="color: #66cc66;">&#40;</span>bitmapData, <span style="color: #000000; font-weight: bold;">new</span> Matrix<span style="color: #66cc66;">&#40;</span>nextScaleX, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span>, nextScaleY<span style="color: #66cc66;">&#41;</span>, <span style="color: #000000; font-weight: bold;">null</span>, <span style="color: #000000; font-weight: bold;">null</span>, <span style="color: #000000; font-weight: bold;">null</span>, <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; bitmapData = temp;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; nextScaleX *= IDEAL_RESIZE_PERCENT;<br />
&nbsp; &nbsp; nextScaleY *= IDEAL_RESIZE_PERCENT;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #b1b100;">while</span> <span style="color: #66cc66;">&#40;</span>nextScaleX&gt;= scaleX || nextScaleY&gt;= scaleY<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> actualScaleX:<span style="color: #0066CC;">Number</span> = nextScaleX&gt;= scaleX ? IDEAL_RESIZE_PERCENT : <span style="color: #cc66cc;">1</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> actualScaleY:<span style="color: #0066CC;">Number</span> = nextScaleY&gt;= scaleY ? IDEAL_RESIZE_PERCENT : <span style="color: #cc66cc;">1</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; temp = <span style="color: #000000; font-weight: bold;">new</span> BitmapData<span style="color: #66cc66;">&#40;</span>bitmapData.<span style="color: #0066CC;">width</span>*actualScaleX, bitmapData.<span style="color: #0066CC;">height</span>*actualScaleY, <span style="color: #000000; font-weight: bold;">true</span>, <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; temp.<span style="color: #006600;">draw</span><span style="color: #66cc66;">&#40;</span>bitmapData, <span style="color: #000000; font-weight: bold;">new</span> Matrix<span style="color: #66cc66;">&#40;</span>actualScaleX, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span>, actualScaleY<span style="color: #66cc66;">&#41;</span>, <span style="color: #000000; font-weight: bold;">null</span>, <span style="color: #000000; font-weight: bold;">null</span>, <span style="color: #000000; font-weight: bold;">null</span>, <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; bitmapData.<span style="color: #006600;">dispose</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; nextScaleX *= IDEAL_RESIZE_PERCENT;<br />
&nbsp; &nbsp; &nbsp; &nbsp; nextScaleY *= IDEAL_RESIZE_PERCENT;<br />
&nbsp; &nbsp; &nbsp; &nbsp; bitmapData = temp;<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span> bitmapData;<br />
<span style="color: #66cc66;">&#125;</span></div>
</div>
</div>
<p></p>
<p>Enjoy!</p>
<p><strong>Update:</strong> I was getting unsatisfactory images when the resize scale was more than 50%. For example, the original code posted would size an image from 100x100 to 60x60 using one BitmapData.draw() step. And it didn't look that great.</p>
<p>I found that if I sized the image up to a scale that allowed it to be size back down by exactly 50% that the results were much better. In the above example, the 100x100 would scale up by 120% to 120x120, then scale down 50% to 60x60. The final image looks much better this way. The code has been updated to work like this. It also had the option to turn constrain proportions off.</p>
<p><strong>Update:</strong> I've <a href="http://code.google.com/p/jacwright/source/browse/#svn/trunk/flash/jac/src/jac/image">posted my code</a> library to Google Code. You can see my final implementation of bitmap resizing in the <a href="http://code.google.com/p/jacwright/source/browse/trunk/flash/jac/src/jac/image/ImageUtils.as">ImageUtils</a> class.</p>
]]></content:encoded>
			<wfw:commentRss>http://jacwright.com/blog/221/high-quality-high-performance-thumbnails-in-flash/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Would it be bad to leave behind our Flash roots?</title>
		<link>http://jacwright.com/blog/209/would-it-be-bad-to-leave-behind-our-flash-roots/</link>
		<comments>http://jacwright.com/blog/209/would-it-be-bad-to-leave-behind-our-flash-roots/#comments</comments>
		<pubDate>Thu, 14 May 2009 17:02:49 +0000</pubDate>
		<dc:creator>Jacob Wright</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://jacwright.com/blog/?p=209</guid>
		<description><![CDATA[I am working with Tyler on Stealth, our high-performance component framework. After reading this article on performance by Arno Gourdol of Adobe I began wondering if we should leave behind our Flash roots of motion and timeline design by defaulting framerate to 0 in our Stealth-based applications. Framerate makes great sense when doing games or [...]]]></description>
			<content:encoded><![CDATA[<p>I am working with <a href="http://www.xtyler.com/">Tyler</a> on Stealth, our high-performance component framework. After reading <a href="http://arno.org/arnotify/2009/05/writing-well-behaved-efficient-air-applications/" title="Writing well-behaved, efficient, AIR applications">this article</a> on performance by Arno Gourdol of Adobe I began wondering if we should leave behind our Flash roots of motion and timeline design by defaulting framerate to 0 in our Stealth-based applications.</p>
<p>Framerate makes great sense when doing games or timeline based animations, but in applications do we need it? We can update the screen on mouse moves, roll overs, etc. with the MouseEvent.updateAfterEvent instance method. And for transitions and tweening the class could use a Timer for the duration of the animation and again call Timer.updateAfterEvent. Then the screen would only refresh when it needs to. Performance would be greatly increased. Seems like it makes sense. Would this be something to add to Flex? Would it give us the performance we need/want for mobile applications and more responsive desktop applications?</p>
<p>Any foreseeable drawbacks? What do you think?</p>
<p><strong>Update:</strong> I did some testing and it seems that the Timer class is directly influenced by the frameRate. With a frame rate of 0 a timer which should fire immediately (set to 0ms) doesn't fire for 20 seconds! With the frame rate a 0.1 it happens at about 2 seconds, a frame rate of 1 is about 145 ms and a frame rate of anything over 4 seems to be around the same (10ms - 30ms probably depending on what the OS is currently doing).</p>
<p>MouseEvent updating and such happen as they should however, so as long as you start of with a frame rate of 4 so that the app can initialize visually, you could drop it down to 0 until a tween is needed and then bump it up to 4 for the duration of the tween. The rest of the visual changes can respond to mouse events (resize, click, rollover, etc). Or leaving it at 4 frames a second probably isn't too bad on CPU, either way, you'd have to call updateAfterEvent when needed.</p>
]]></content:encoded>
			<wfw:commentRss>http://jacwright.com/blog/209/would-it-be-bad-to-leave-behind-our-flash-roots/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Flight Framework Highlights</title>
		<link>http://jacwright.com/blog/144/flight-framework-highlights/</link>
		<comments>http://jacwright.com/blog/144/flight-framework-highlights/#comments</comments>
		<pubDate>Thu, 12 Feb 2009 18:46:03 +0000</pubDate>
		<dc:creator>Jacob Wright</dc:creator>
				<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://jacwright.com/blog/?p=144</guid>
		<description><![CDATA[The Flight Framework is basically a collection of great utilities and independent tidbits that are organized to help us build our application. So I thought I'd make a call out to all the great standalone features in Flight, tell what they are, and leave it to another day to go more in depth on them. [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.flightxd.com/flightframework/">Flight Framework</a> is basically a collection of great utilities and independent tidbits that are organized to help us build our application. So I thought I'd make a call out to all the great standalone features in Flight, tell what they are, and leave it to another day to go more in depth on them.</p>
<ol>
<li><strong>Fix for abstract classes</strong><br />
The tiny static classes in the flight.error package allow you to ensure an abstract class is not instantiated and that abstract methods are overriden.</li>
<li><strong>Registry</strong><br />
A global registry to store objects or data that anything in an application can have access too.</li>
<li><strong>Reflection<br />
</strong>The "Type" class handles all your reflection needs, including caching the expensive describeType calls and helping pull out needed metadata.</li>
<li><strong>Nice base for models<br />
</strong>The ValueObject class is a lazy IEventDispatcher that implements an equals() and clone() method which will work with all subclasses.</li>
<li><strong>ValueObjectEditor</strong><br />
This nifty utility lets you "edit" a ValueObject and then either commit the changes or revert them. Great for dialogs that let ValueObjects be changed but can then either Cancel or Ok the change.</li>
<li><strong>AS3 ArrayContainer</strong><br />
When working in an AS3 project, it would be nice to know when an array is changed, but Flex's ArrayCollection brings in half the framework when referenced. This little guy is the little brother AS3 has been wishing for.</li>
<li><strong>Services<br />
</strong>Some common services (RPC services, e.g. remoting, HTTP, etc.) that can be used in Flex or AS3. Much smaller than Flex's built in services.</li>
<li><strong>Configuration<br />
</strong>Config lets you define your application configurations in the app, an XML file, SharedObjects, and even the URL. Not only that, you can have multiple sources with some overriding others, and it is all accessible to your classes through a global config property. Super neat!</li>
<li><strong>Undo framework</strong><br />
With CommandHistory and all the command interfaces available, you can build undo-redo into your application without using any of the rest of Flight. Way, way awesome.</li>
<li><strong>Weak-referenced binding</strong><br />
Using the Bind class you can create faster, smaller, and weak-referenced binds. With two-way deep binds and being able to use in AS3-only projects without importing half the Flex framework, this is my favorite nugget.</li>
</ol>
<p>None of the above pieces references any of the others. They can all be used independently in your own frameworks or applications. That's my favorite part about Flight, is I can use it 100% if I want to, but if I can't that doesn't mean I have to give up my favorite features. I could use any/all of the above with any other framework, AS3 only, or Flex.</p>
]]></content:encoded>
			<wfw:commentRss>http://jacwright.com/blog/144/flight-framework-highlights/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Undo/Redo for all your TextFields</title>
		<link>http://jacwright.com/blog/112/undo-redo-for-all-textfields/</link>
		<comments>http://jacwright.com/blog/112/undo-redo-for-all-textfields/#comments</comments>
		<pubDate>Wed, 04 Feb 2009 11:00:12 +0000</pubDate>
		<dc:creator>Jacob Wright</dc:creator>
				<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://jacwright.com/blog/?p=112</guid>
		<description><![CDATA[I made the TextField undo component. Add this component to any Flash or Flex application and all your text components will have undo and redo. This has been open sourced and is on http://code.google.com/p/undo-textfields/. Instead of making different Flex and Flash components to use in place of the available components, I made one that adds [...]]]></description>
			<content:encoded><![CDATA[<p>I made the TextField undo component. Add this component to any Flash or Flex application and all your text components will have undo and redo. This has been open sourced and is on <a title="Google Code Project" href="http://code.google.com/p/undo-textfields/">http://code.google.com/p/undo-textfields/</a>.</p>
<p>Instead of making different Flex and Flash components to use in place of the available components, I made one that adds undo to existing text components. It should work in Flash and in Flex, though I just have a Flex example to show you today. You can see that it can be container specific, though you would probably just put it on the root of your application or the stage. Type in the text components in the top panel. Then do the same in the bottom. You should be able to press Ctrl+Z and Ctrl+Y (or Ctrl+Shift+Z) to undo and redo. If you're on a Mac just substitute Ctrl with Cmd. I've only tested it in Safari and Firefox on a Mac. I hope the key command work on other machines without issue. But I also added a couple of menu items to the right-click context menu. Give it a whirl below, view the source, and see how easy it is to add text undo and redo to all your existing applications without any refactoring.</p>
<p><strong>Update:</strong> The keyboard shortcuts don't work in the ActiveX version of Flash (Internet Explorer on Windows).</p>

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_0" width="100%" height="430" align="center">
      <param name="movie" value="http://jacwright.com/blog/wp-content/uploads/2009/02/undotest.swf" />
      <param name="align" value="center" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://jacwright.com/blog/wp-content/uploads/2009/02/undotest.swf" width="100%" height="430" align="center">
      <!--<![endif]-->
        Undo TextFields
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>

<p>Let me know if the key-shortcuts don't work on your system. Maybe phase 2 can be some javascript magic to capture those better.</p>
]]></content:encoded>
			<wfw:commentRss>http://jacwright.com/blog/112/undo-redo-for-all-textfields/feed/</wfw:commentRss>
		<slash:comments>49</slash:comments>
		</item>
		<item>
		<title>Undo in TextFields</title>
		<link>http://jacwright.com/blog/109/undo-in-textfields/</link>
		<comments>http://jacwright.com/blog/109/undo-in-textfields/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 17:01:10 +0000</pubDate>
		<dc:creator>Jacob Wright</dc:creator>
				<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://jacwright.com/blog/?p=109</guid>
		<description><![CDATA[I presented on creating your own undo/redo at 360 MAX unconference and a uFlash meeting. People seemed interested in knowing how to do it, but were more interested in having the code. It really should be part of Flex TextAreas and TextInputs. So I was going to code up a couple custom components that extended [...]]]></description>
			<content:encoded><![CDATA[<p>I presented on creating your own undo/redo at 360 MAX unconference and a uFlash meeting. People seemed interested in knowing how to do it, but were more interested in having the code. It really should be part of Flex TextAreas and TextInputs. So I was going to code up a couple custom components that extended TextArea and TextInput (e.g. UndoableTextArea) and release them for use. However, as <a href="http://www.xtyler.com" title="My twin brother">Tyler</a> reminded me, that wouldn't work in Flash apps, only Flex. So I have a proposal and would like to get your feedback.</p>
<p>If I created a component that you put on the root of your application (or any MXML component) which added undo/redo to any/all INPUT TextFields with in Flash or Flex would that be better? If you're not doing any custom INPUT TextFields I don't see any issues. But it could cause problems if you're doing your own text components. Also, I would do it by listening to Event.ADDED events and whenever a TextField is added to the display list it would initialize it and add some right-click menu items to it. And I can even make sure when I have script access through ExternalInterface to capture the Ctrl+Z key combo.</p>
<p>Comment and let me know if this would be better than the Flex components. It would work in Flash apps too is the nice part and also you could add it to existing applications without any find-replace. The downsides is it could interfere with text manipulation code you may have in place for custom text components. I'll decide this week and get to work on it next!</p>
]]></content:encoded>
			<wfw:commentRss>http://jacwright.com/blog/109/undo-in-textfields/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Using Your Own Custom Metadata in AS3</title>
		<link>http://jacwright.com/blog/72/using-your-own-custom-metadata-in-as3/</link>
		<comments>http://jacwright.com/blog/72/using-your-own-custom-metadata-in-as3/#comments</comments>
		<pubDate>Sat, 15 Mar 2008 20:57:54 +0000</pubDate>
		<dc:creator>Jacob Wright</dc:creator>
				<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://jacwright.com/blog/72/using-your-own-custom-metadata-in-as3/</guid>
		<description><![CDATA[Flex 3 gives us a great new feature, custom metadata tags. Now, I know you could actually use custom metadata in Flex 2, but you would have to add "-keep-as3-metadata MyTag" to every single project that utilized these custom tags. In Flex 3, if you add "-keep-as3-metadata MyTag" to a library (using compc to compile [...]]]></description>
			<content:encoded><![CDATA[<p>Flex 3 gives us a great new feature, custom metadata tags. Now, I know you could actually use custom metadata in Flex 2, but you would have to add "-keep-as3-metadata MyTag" to every single project that utilized these custom tags. In Flex 3, if you add "-keep-as3-metadata MyTag" to a library (using compc to compile a SWC or a Flex Builder Library project), then EVERY project that uses that SWC will automatically keep the "MyTag" metadata tags. This allows custom libraries that utilize these tags for development.</p>
<p>Would be cool to create a library to hook up listeners so you can create listeners like this:</p>
<div class="code">
<div class="syntax_hilite">
<div id="actionscript-4">
<div class="actionscript"><span style="color: #66cc66;">&#91;</span>Listen<span style="color: #66cc66;">&#40;</span>obj=<span style="color: #ff0000;">"this.closeButton"</span>, event=<span style="color: #ff0000;">"click"</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span><br />
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> closeClickHandler<span style="color: #66cc66;">&#40;</span>event:MouseEvent<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>...<span style="color: #66cc66;">&#125;</span></div>
</div>
</div>
<p></div>
<p>You'd use -keep-as3-metadata Listen in the libraries compiler options. Maybe if you want I could post a tutorial on doing something like this. Drop me note and let me know if there is interest.</p>
]]></content:encoded>
			<wfw:commentRss>http://jacwright.com/blog/72/using-your-own-custom-metadata-in-as3/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Flight Stealth, a Flex Component Alternative</title>
		<link>http://jacwright.com/blog/66/flight-stealth-a-flex-component-alternative/</link>
		<comments>http://jacwright.com/blog/66/flight-stealth-a-flex-component-alternative/#comments</comments>
		<pubDate>Thu, 07 Feb 2008 17:09:28 +0000</pubDate>
		<dc:creator>Jacob Wright</dc:creator>
				<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://jacwright.com/blog/66/flight-stealth-a-flex-component-alternative/</guid>
		<description><![CDATA[The first question you probably have after seeing the title of this post is "why would you make an alternative to Flex?" Or perhaps, "how could you even think of competing with Flex?" Honestly, we aren't trying to compete. This will be open source. And alternatives are always nice to have. We could talk about [...]]]></description>
			<content:encoded><![CDATA[<p>The first question you probably have after seeing the title of this post is "why would you make an alternative to Flex?" Or perhaps, "how could you even think of competing with Flex?" Honestly, we aren't trying to compete. This will be open source. And alternatives are always nice to have. We could talk about how difficult it can be to extend the Flex components, how limited the styling is, or how Flex makes complicated things easy and easy things complicated, but the fact of the matter is we just thought building an alternative would be fun.</p>
<p>Now, that being said, I think we're going to have a KILLER alternative to Flex. We (Tyler Wright, my twin, and I) have been wanting to do something like this for awhile. After hearing Ely Greenfield's Flex roadmap presentation at MAX we got all excited about it again. Much of what was presented there are things we've had in mind and wanting to build. I've been working on a proof-of-concept over the last few weeks, although we've worked on it off and on for a couple of years, and we are definitely headed in the right direction. I'll list here a bunch of the stuff we've got worked out so far.</p>
<p><span id="more-66"></span></p>
<h2>Features</h2>
<h3>Model View Controller Architecture</h3>
<p>Flight's components, code-named Stealth (because code names are cool!), are fully MVC show-off worthy. Each component (model) has a skin (view) and behaviors (controller) which are set at run-time. A component will have one skin, but could have many behaviors. User-input listeners only appear in the behaviors, databinding is used in the skin, and the component doesn't have to worry about anything but it's own logic. There is also a concept of "content" we are borrowing from (dun dun daaaaaa) Microsoft's Blend. Content is data assigned to a component that can be displayed or used by the skin and covers anything from a Button's label to a List's dataProvider.</p>
<p><img src='http://jacwright.com/blog/wp-content/uploads/2008/02/pieces.png' alt='Stealth Pieces' /></p>
<h3>Layout</h3>
<p>Instead of having special components called containers that deal with laying out their children, every component has layout. That means you have a nice way to tell the icon in your button to be on the right or the left of your label. You can have somethings laid out horizontally in a panel and some things absolute positioned. Layout doesn't just work horizontally, vertically, or absolute though. It uses concepts such as anchor, dock, and tile. These will be explained in detail at a later date. AND last but not least to me, when something turns visible=false it is removed from the layout. I've always used visible and includeInLayout together with Flex and it's always bugged me that turning it invisible didn't automatically remove it from the layout. Yay!!</p>
<h3>State</h3>
<p>Components always have state. You could consider all the data in a component its current state, however, lots of state is dependent on the behavior of a component. If a component behaves like a Button, for example, you'll have mouseUp, mouseOver, and mouseDown states. If it is a toggle button you'll also have selected state. And if it's an application area you might give it state's such as screen = "login". So Stealth provides a state object that you can set mouse state, selected state, and any other state you might desire on it. This allows behaviors to add new types of state at run time.</p>
<h3>Style</h3>
<p>Stealth has full CSS selector support. This means you can parse a stylesheet at runtime and have "Application #loginScreen Form .inputs" styled just the way you need it. The styles also have state support using pseudo selectors. This would allow your application to show and hide different screens depending on their state like this "Application:login #loginScreen {visible: true;}". Skins and behaviors are assigned via stylesheets at runtime as well: "Button { skin: ButtonSkin; behaviors: ButtonBehavior ToggleBehavior; }".</p>
<p>Styles pull it all together like this:</p>
<p><img src='http://jacwright.com/blog/wp-content/uploads/2008/02/piecesfit.png' alt='How Stealth Pieces Fit' /></p>
<h3>MXML Skinning</h3>
<p>And finally, we've worked it out such that even though Stealth is not Flex, you can still use Flex Builder and MXML to create and define your skins and application. This was the "make it or break it" part of the deal for Stealth. Once we knew we could still use markup to define the layout and that we still had all the autocomplete and refactoring that Flex Builder provides, we were sold.</p>
<p>Right now Tyler, myself and hopefully soon Rob Taylor from <a href="http://flashextensions.com">flashextensions.com</a> are working on it (I hope you don't mind the mention Rob), but we hope to get the code public soon so that others can help and everyone can check in on the progress.</p>
<p>I really want to get a demo up that showcases the styling. That may or may not happen soon as I'm working on a project that may continue until April 15 (to pay off the government for all my contracting last year). :D  I'll stop procrastinating tomorrow.</p>
]]></content:encoded>
			<wfw:commentRss>http://jacwright.com/blog/66/flight-stealth-a-flex-component-alternative/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Flex or the Server, What&#8217;s Your Focus?</title>
		<link>http://jacwright.com/blog/65/flex-or-the-server-whats-your-focus/</link>
		<comments>http://jacwright.com/blog/65/flex-or-the-server-whats-your-focus/#comments</comments>
		<pubDate>Sat, 26 Jan 2008 05:40:29 +0000</pubDate>
		<dc:creator>Jacob Wright</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://jacwright.com/blog/65/flex-or-the-server-whats-your-focus/</guid>
		<description><![CDATA[I've been thinking deeply about how applications are architected. Tyler and I put together a MVC framework which we've been reluctant to release because he's not sure if it's quite right or if it's different enough from other frameworks, and because I don't have time to put it up and document it. So we've been [...]]]></description>
			<content:encoded><![CDATA[<p>I've been thinking deeply about how applications are architected. Tyler and I put together a MVC framework which we've been reluctant to release because he's not sure if it's quite right or if it's different enough from other frameworks, and because I don't have time to put it up and document it. So we've been brainstorming on how it might be better.</p>
<p>I've decided that there are two main focuses when designing a Flex application, and it results in two different kinds of frameworks. There is Flex-focused applications and server-focused applications. The difference between these two applications is the location of the majority of domain logic.</p>
<p>In Flex-focused applications you have a full domain model with methods and properties and relationships between the models. There is a lot of logic on the Flex side that is not presentation logic.</p>
<p>In server-focused applications Flex takes on a view role. This is where value objects are used the most. More calls are probably made to the server because the Flex app needs to know what to do next or to display next. The Flex app contains mostly presentation logic.</p>
<p>Right now I think most of the popular frameworks are server-focused. Value objects are abundantly used. A ModelLocator is used because the model on the Flex side is pretty flat.</p>
<p>Right now I mostly do Flex-focused development. Not because I am not as comfortable on the server, but because the applications I make are things like image editors, document creators, etc. and not dashboards into server views. Right now I need a different kind of framework. Right now I need something other than Cairngorm or PureMVC.</p>
]]></content:encoded>
			<wfw:commentRss>http://jacwright.com/blog/65/flex-or-the-server-whats-your-focus/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Flex WISHED It Supported CSS</title>
		<link>http://jacwright.com/blog/63/flex-wished-it-supported-css/</link>
		<comments>http://jacwright.com/blog/63/flex-wished-it-supported-css/#comments</comments>
		<pubDate>Thu, 17 Jan 2008 22:30:21 +0000</pubDate>
		<dc:creator>Jacob Wright</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://jacwright.com/blog/63/flex-wished-it-supported-css/</guid>
		<description><![CDATA[I was reading a post about the Top 10 Flex Misconceptions and read in the 2nd section that "Flex also uses CSS for styling of components / applications." I know since day one Adobe has listed CSS styling as a feature of Flex. But anyone who has used CSS to style a web page knows [...]]]></description>
			<content:encoded><![CDATA[<p>I was reading a post about the <a href="http://www.infoq.com/news/2007/12/top-10-flex-misconceptions">Top 10 Flex Misconceptions</a> and read in the 2nd section that "Flex also uses CSS for styling of components / applications."</p>
<p>I know since day one Adobe has listed CSS styling as a feature of Flex. But anyone who has used CSS to style a web page knows that Flex does not support CSS. It supports, well, SS.</p>
<p>CSS stands for Cascading Style Sheets. Flex is missing the "Cascading" part of it. CSS is all about using a style sheet to describe the "presentation of the document" (<a href="http://www.w3.org/TR/REC-CSS1">World Wide Web Consortium CSS1</a>). Because of the limited amount of the CSS standard that Flex supports, you really can't define that without a LOT of verbosity.</p>
<p>Let's take some examples of what I'd LIKE to do in Flex, sometimes I can, sometimes I can't. I'd like to set the colors in my scrollbar buttons. Well, I can do this by using the many styles defined in ScrollBar such as upArrowUpSkin, upArrowOverSkin, and upArrowDownSkin. I had to look up the styles for ScrollBar to see if I could do that. Buttons have some nice styles that let you set the background color, but I can't access that so I'll have to replace the skin entirely.</p>
<div class="code">
<div class="syntax_hilite">
<div id="css-8">
<div class="css">ScrollBar <span style="color: #66cc66;">&#123;</span><br />
&nbsp; upArrowUpSkin: Embed<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"myUpArrowUp.png"</span><span style="color: #66cc66;">&#41;</span>;<br />
... etc.<br />
<span style="color: #66cc66;">&#125;</span></div>
</div>
</div>
<p></div>
<p>Now if I wanted to change those colors for this area of my app or that area, or for popups only etc. I'd have to go through and make sure each ScrollBar had a styleName that I could then use in the stylesheet for that. Here's what you SHOULD be able to do with CSS:</p>
<div class="code">
<div class="syntax_hilite">
<div id="css-9">
<div class="css">#certainPartOfMyApp ScrollBar Button<span style="color: #6666ff;">.up </span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; background-gradient-colors: #999, #555;<br />
<span style="color: #66cc66;">&#125;</span><br />
#certainPartOfMyApp ScrollBar Button<span style="color: #6666ff;">.down </span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; background-gradient-colors: #555, #999;<br />
<span style="color: #66cc66;">&#125;</span></div>
</div>
</div>
<p></div>
<p>Beautiful! Flex component developers didn't need to add a style on the ScrollBar component for every conceivable style that one might want to change for its buttons. With real CSS you can access them because the selectors allow your styles to cascade down to all scrollbars under the component with an ID of certainPartOfMyApp. I could have had one definition to style ALL buttons under that ScrollBar, but decided to use the styleNames which might be in place if Flex supported this to style each button separately.</p>
<p>Now if you were to use CSS pseudo selectors (e.g. a:hover) and mapped them to a component's "state" then you could really get going. Say your main application has several states in which different areas of the APP are viewable.</p>
<div class="code">
<div class="syntax_hilite">
<div id="css-10">
<div class="css"><span style="color: #808080; font-style: italic;">/* setting the state of the app will automatically change what Canvas<br />
is showing. Good-bye ViewStack! */</span><br />
#app Canvas <span style="color: #66cc66;">&#123;</span><br />
&nbsp; <span style="color: #993333;">visible</span>: false;<br />
<span style="color: #66cc66;">&#125;</span><br />
#app<span style="color: #3333ff;">:login </span><span style="color: #cc00cc;">#loginScreen <span style="color: #66cc66;">&#123;</span></span><br />
&nbsp; <span style="color: #993333;">visible</span>: true;<br />
<span style="color: #66cc66;">&#125;</span><br />
#app<span style="color: #3333ff;">:catalog </span><span style="color: #cc00cc;">#catalogScreen <span style="color: #66cc66;">&#123;</span></span><br />
&nbsp; <span style="color: #993333;">visible</span>: true;<br />
<span style="color: #66cc66;">&#125;</span><br />
#app<span style="color: #3333ff;">:checkout </span><span style="color: #cc00cc;">#checkoutScreen <span style="color: #66cc66;">&#123;</span></span><br />
&nbsp; <span style="color: #993333;">visible</span>: true;<br />
<span style="color: #66cc66;">&#125;</span></p>
<p><span style="color: #808080; font-style: italic;">/* We should even be able to set the width/height/x/y in styles shouldn't we? Not just top, left, bottom, and right */</span><br />
#catalogScreen <span style="color: #6666ff;">.leftColumn </span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">width</span>: <span style="color: #cc66cc;">200</span>;<br />
<span style="color: #66cc66;">&#125;</span><br />
#catalogScreen <span style="color: #6666ff;">.rightColumn </span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">width</span>: <span style="color: #cc66cc;">100</span>%;<br />
<span style="color: #66cc66;">&#125;</span><br />
#catalogScreen<span style="color: #3333ff;">:addToCart </span><span style="color: #6666ff;">.leftColumn </span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">width</span>: <span style="color: #cc66cc;">100</span>%;<br />
<span style="color: #66cc66;">&#125;</span><br />
#catalogScreen<span style="color: #3333ff;">:addToCart </span><span style="color: #6666ff;">.rightColumn </span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">width</span>: <span style="color: #cc66cc;">200</span>;<br />
<span style="color: #66cc66;">&#125;</span></div>
</div>
</div>
<p></div>
<p>Now when I change the state of my app a different view is presented. And when I change the state of my catalogScreen the columns change their size, perhaps throwing an effect in there for smoothness could be part of the CSS as well.</p>
<p>I've put together a full implementation of CSS2 as far as the format is concerned and the selectors etc. It doesn't use the box model etc. that HTML uses, but I'll post a demo of it up here soon. It will of necessity use my own components because there is no way to integrate it into the existing Flex styling framework. I've looked, I've tried. :)</p>
<h3>Vote For CSS!</h3>
<p>If enough of us ask for it Adobe will give it to us. It's already too late to include in Flex 3 which should be coming out soon, but now is the time to be asking for big changes like this for Flex 4. Go sign up and vote for this feature in <a href="https://bugs.adobe.com/jira/browse/SDK-14385">Adobe's bug base</a>.</p>
<p><strong>UPDATE:</strong> Thanks to all those who voted this bug was fixed (or feature added) in Flex 4! Great job everybody. And thank you Adobe for listening to the community.</p>
]]></content:encoded>
			<wfw:commentRss>http://jacwright.com/blog/63/flex-wished-it-supported-css/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
