<?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"
	>

<channel>
	<title>neatFilm.com</title>
	<atom:link href="http://www.neatfilm.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.neatfilm.com</link>
	<description></description>
	<pubDate>Wed, 03 Sep 2008 20:54:32 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
	<language>en</language>
			<item>
		<title>AIR Application Syslog with SQLite</title>
		<link>http://www.neatfilm.com/2008/09/01/air-syslog-with-sqlite-source-code/</link>
		<comments>http://www.neatfilm.com/2008/09/01/air-syslog-with-sqlite-source-code/#comments</comments>
		<pubDate>Tue, 02 Sep 2008 02:38:35 +0000</pubDate>
		<dc:creator>george</dc:creator>
		
		<category><![CDATA[AIR Runtime]]></category>

		<category><![CDATA[ActionScript 3]]></category>

		<category><![CDATA[Flex 3]]></category>

		<guid isPermaLink="false">http://www.neatfilm.com/?p=190</guid>
		<description><![CDATA[In AIR (Flex/Flash) application, syslog support might be very useful for QA/developers also can be helpful for end user as well. I wrote some fast code for my personal project Dailytasks on this (and another more complex SQLite database with transaction manager) during this long weekend.

You can download source code from here. (Need some tweaks [...]]]></description>
			<content:encoded><![CDATA[<p>In AIR (Flex/Flash) application, syslog support might be very useful for QA/developers also can be helpful for end user as well. I wrote some fast code for my personal project <a href="http://dailytasks.net/">Dailytasks</a> on this (and another more complex SQLite database with transaction manager) during this long weekend.</p>

<p>You can download source code from <a href="http://www.neatfilm.com/flash/download/sqlite_log.zip">here</a>. (Need some tweaks to fit your own application for sure.)</p>

<p>Here&#8217;s how it works:
<ul>
    <li>(Run once and comment it out) Create syslog database file and table. (I use some code to create and run once only, when I need update my table structure, rebuild database again.)</li>
    <li>Initialize SyslogService instance in preinitialize process of application. (it will open SQLConnection and compile statement to be used later.)</li>
    <li>Call static function from any points, i.e.:
<ul>
    <li><code>SyslogService.log(SyslogLevel.INFO, 'Application start.');</code></li>
</ul>
</li>
    <li>If statement is executing, push log data into stack and insert after.</li>
</ul>
Update (September 3):
</p><p style="padding-left: 30px;">I don&#8217;t have time to test completely. If you got database open error, just add open listener before execute the statement. Code is just simple like this.</p>
<p style="padding-left: 30px;"><code>if(!sqlConnection.connected)</code></p>
<p style="padding-left: 60px;"><code>sqlConneciton.addEventListener ...</code></p>
<p style="padding-left: 30px;">Because the connection and statement will be reused all the time, you need to detect only once.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neatfilm.com/2008/09/01/air-syslog-with-sqlite-source-code/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SQLite Notes</title>
		<link>http://www.neatfilm.com/2008/06/13/sqlite-notes/</link>
		<comments>http://www.neatfilm.com/2008/06/13/sqlite-notes/#comments</comments>
		<pubDate>Fri, 13 Jun 2008 18:56:45 +0000</pubDate>
		<dc:creator>george</dc:creator>
		
		<category><![CDATA[AIR Runtime]]></category>

		<category><![CDATA[ActionScript 3]]></category>

		<category><![CDATA[Flex 3]]></category>

		<guid isPermaLink="false">http://www.neatfilm.com/?p=72</guid>
		<description><![CDATA[Execute statement

Every statement has an associated connection object, a statement represents a single &#8216;compiled&#8217; SQL statement. There&#8217;re two methods to execute SQLStatement instance in AIR, one execute a single statement each time, another use .begin() .commit() to execute multiple statements, as a transaction. For SQLite engine, they both transaction, the single statement operates in autocommit [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Execute statement</strong></p>

<p>Every statement has an associated connection object, a statement represents a single &#8216;compiled&#8217; SQL statement. There&#8217;re two methods to execute SQLStatement instance in AIR, one execute a single statement each time, another use .begin() .commit() to execute multiple statements, as a transaction. For SQLite engine, they both transaction, the single statement operates in autocommit mode by default.</p>

<p>SQL statement execution process:
<code> Statement+SQL -&gt; Compilation -&gt; Byte Code (with parameters) -&gt; execution -&gt; Finalization</code></p>

<p>Use parameters for statements is highly recommended. One important benefit Adobe might not documented: SQLite takes care of escaping the string values binding to parameters, helping avoid syntax errors and SQL injection attacks, i.e, it will convert &#8216; to &#8221;.</p>

<p><strong>Transaction and Locks</strong>
<ul>
    <li>Multiple read transactions (SELECT), one single write transaction (INSERT/UPDATE/DELETE) at a time.</li>
    <li>When write transaction is writing (exclusive locked), no new transactions can connect.</li>
    <li>Write transaction will wait for any running read transactions to finish before writing.</li>
</ul>
Each transaction (or SQLStatement execution in autocommit mode) transit from one state to another state.</p>

<p>A default SELECT statement run in path as followed:
<code>Unlocked -&gt; Pending -&gt; Shared -&gt; Unlocked</code></p>

<p>Two SELECT statements grouped with .begin() and .commit() in a single transaction:</p>

<p><code>Unlocked -&gt; Pending -&gt; Shared -&gt; Unlocked</code></p>

<p>Two SELECT statements run in turn:</p>

<p><code>Unlocked -&gt; Pending -&gt; Shared -&gt; Unlocked -&gt; Pending -&gt; Shared -&gt; Unlocked</code></p>

<p>A write transaction (i.e. UPDATE) by default (autocommit mode):</p>

<p><code>Unlocked -&gt; Pending -&gt; Shared -&gt; Reserved -&gt; Pending -&gt; Exclusive locked(commit) -&gt; Unlocked</code></p>

<p>A write transaction with &#8216;BEGIN IMMEDIATE&#8217;:</p>

<p><code>Reserved -&gt; Pending -&gt; Exclusive locked(commit) -&gt; Unlocked</code></p>

<p>The &#8216;Reserved&#8217; state is a tricky state that may a place to improve performance. It actually store modifications in a memory cache, and create a rollback journal file for possible crash recovery. In this state the write transaction get real work done without affecting other read transactions. That&#8217;s how &#8216;multiple reader, one writer&#8217; works.</p>

<p>After the write transaction get it work done, it begins trying get a Pending lock to move to Exclusive commit state, where (Pending) no more new read/write transactions (they have to wait in queue), the write transaction need to wait any other transactions still working to finish. Only after anything else cleared, this transaction enter into Exclusive state.</p>

<p>The &#8216;Exclusive&#8217; state is to flush the modifications from cache to database file.</p>

<p>SQLConnection has a property cacheSize that affect write transaction. In &#8216;Reserved&#8217; state if page cache fills up, it have to move to &#8216;Exclusive&#8217; state before finish its own task. The bigger cacheSize the more modified pages can store and minimize the time to be used in &#8216;Exclusive&#8217; state. (sqlite_analyzer can dump detailed statistics helpful for adjusting cacheSize)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neatfilm.com/2008/06/13/sqlite-notes/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Personal Thoughts, Future Changes in Flash Community for Developers?</title>
		<link>http://www.neatfilm.com/2008/03/12/personal-thoughts-future-changes-in-flash-community-for-developers/</link>
		<comments>http://www.neatfilm.com/2008/03/12/personal-thoughts-future-changes-in-flash-community-for-developers/#comments</comments>
		<pubDate>Wed, 12 Mar 2008 19:55:07 +0000</pubDate>
		<dc:creator>george</dc:creator>
		
		<category><![CDATA[ActionScript 3]]></category>

		<guid isPermaLink="false">http://www.neatfilm.com/2008/03/14/personal-thoughts-future-changes-in-flash-community-for-developers/</guid>
		<description><![CDATA[Two years ago when ActionScript 3 introduced to Flash community, Flex 2 was the first citizen of next generation of Flash platform, before Flash CS3 released almost a year later (count in Flex 2 beta versions). I don&#8217;t know how many percents of former Flash developers has already worked with AS3 today, but one thing [...]]]></description>
			<content:encoded><![CDATA[<p>Two years ago when ActionScript 3 introduced to Flash community, Flex 2 was the first citizen of next generation of Flash platform, before Flash CS3 released almost a year later (count in Flex 2 beta versions). I don&#8217;t know how many percents of former Flash developers has already worked with AS3 today, but one thing at least, Flash developers not only excited by the new generation robust AS3 language, but also confused and complained. Some Flash developers argued Flex frameworks, are those Flex applications over-engineering? Why a single Flex component asking for big number of kbytes which not included in RSL? Some voices also come from another side of hill, the mainstream of Flex developers, former Java developers found themselves quite comfortable with Flex frameworks, has some opposite opinions. </p>

<p>What happens to Flash community for Flash developers? What&#8217;s the direction of future Flash developments?</p>

<p>(&#8217;Flex&#8217; means Flex framework projects in this post not include Flex pure actionscript projects)</p>

<p><strong>Flex changing Flash developments</strong></p>

<p>When ActionScript 3 came with Flex 2 two years before, there&#8217;s a strong signal from Adobe, Adobe has great interests to grasp methodologies from Java world, Agile developments into the new generation of Flash. The new AS3 API then has two parts from Adobe:</p>

<ul>
<li><p>Flash Player API. The same part that Flash developers coding in AS2 with Flash IDE (technically new VM for sure), now what Flash developer relying on using Flash CS3 IDE (there&#8217;s still components in Flash CS3, I wonder whether they really useful).</p></li>
<li><p>Flex framework. Visual components and layout containers, styling, event/handler pairs, utility classes, data collections, service/remoting classes, code templates/code injection with MXML scripts and meta data. </p></li>
</ul>

<p>I know some Flash developers, likely refuse to touch the AS3 Flex framework API, refuse the heavy weight kbytes for web applications. Though it has to say, Flex changing Flash developments.</p>

<blockquote>
  <p>The more Flex accepted by the industry, the more it changes Flash developments even without using Flex.</p>
</blockquote>

<p>In sport games, when a challenger got higher score than a former champion, the latter will lose his gold. The only choice he had to fight for another higher score to regained the winner position. Today Flex was accepted by the market, and most important, for clients and end users, Flex equals to Flash, both Flash SWF files running with Flash player VM or AIR. So some situations will be, if something can be done well in Flex, like better usability,  accessibility, functionality, will be requested by clients: &#8216;I like the way of that Flash, do this for me can you?&#8217;   </p>

<p>So in some means, Flex pushing Flash applications to be more complicated than before. The more complex, the more code, and better light-weight architecture, with reasonable design patterns, will be necessary for lots of future AS3 Flash applications. </p>

<p>Second, Flex will change Flash projects by developers. The community now not only has traditional Flash developers, Flex developers, but also between them, there will be a number of Flash &amp;&amp; Flex developers. When these developers join in a Flash project team, experiences from Flex developments and some techniques used in Flex framework which can be found from source code, will be introduced into Flash AS3 projects. For example, early last year I read a mailing list post from a developer of Adobe Flex team (should be James Ward if not wrong), said &#8216;Flex has better solutions to deal with text renderering&#8217;, so when a Flash project has the needs of text renderering optimization, how about to get some ideas from Flex framework source code how Adobe teams improved that?</p>

<p><strong>Flex acceptance</strong></p>

<p>Flex has been accepted well in the industry which no one can ignore. </p>

<ul>
<li><p>Development teams favor more Flex.</p>

<ul>
<li>MXML and meta data, better readability, less code to maintain</li>
<li>Force developers to code under predefined architecture, components/containers, event/handler, developers can be replaced easier by new members.</li>
<li>Possibility for test-driven development and continuous integration, depends on team members&#8217; experiences and time.</li>
</ul></li>
<li><p>Lower budget required.</p>

<ul>
<li>No need developer hours/QA for components/containers offered by Adobe.</li>
<li>Fast mock-up with MXML design view, easy to throw away if not fit.</li>
<li>Flex SDK is free and Flex Builder 3 free for educations, means more cheap developers in the future.</li>
</ul></li>
<li><p>Accepted by market.</p>

<ul>
<li>There&#8217;re many cases where functionality more important than preloading speed even remote websites.</li>
<li>Local networked enterprise applications don&#8217;t care how much kbytes.</li>
<li>AIR applications don&#8217;t care size.</li>
</ul></li>
</ul>

<p><strong>Future Changes?</strong></p>

<p>So Flex has lots of benefits that Flash project couldn&#8217;t have today, what about the old Adobe rumor? Flash IDE for designers, Flex for developers?</p>

<p>I never agree with this. Flash development will not, and never can be replaced by Flex (framework) wholly. </p>

<ul>
<li>Limitation of Flex framework</li>
</ul>

<p>Flex framework was planned for enterprise solutions, even today Internet quite faster than several years before, even Flex 3 introduced RSL solution to reduce kbytes absolutely, in many case, preloading speed can still be a problem to end users, would lose their satisfaction whatever realized or not. </p>

<p>Other cases if end users change their habits, say, some guys using iPhone/iPod more often? Most of Flex applications will be immediately not runnable in those devices. Techniques used by Flex framework to improve development effectiveness are double-edged sword, such as MXML/meta data, which auto-generated source code, automatic components/containers size-measurement, will consume more kbytes/memory than real necessary.</p>

<ul>
<li>Open source light-weight Flash framework for better, faster, lighter Flash applications</li>
</ul>

<p>There&#8217;re already some open source AS3 framework emerged, some for dedicated usage like PV3D, some for light-weight architecture like pureMVC. I think there will be finally one or two mainstream open source Flash frameworks to be used as light-weight alternate to Flex framework (i.e. heavy components like DataGrid not necessary for most of Flash projects), lighter and more freedom to build Flash applications with Flash IDE or Flex pure ActionScript projects. </p>

<p>Open source framework could be faster to change than Flex framework because of less backward compatibility required, result will be Flex framework possibly sometimes get contributions from open source Flash framework by community.</p>

<p>RSL solution for open source Flash framework? How about share unique URLs, i.e. http://osflash.org/share/osrsl_01.swf.</p>

<p>There will be also needs of some external development tools, such as dynamic mock-up, open source automation test tools to be used to improve effectiveness in Flash developments.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neatfilm.com/2008/03/12/personal-thoughts-future-changes-in-flash-community-for-developers/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Flex Challenges for Flash IDE Devleopers</title>
		<link>http://www.neatfilm.com/2008/01/20/flex-challenges-for-flash-ide-devleopers/</link>
		<comments>http://www.neatfilm.com/2008/01/20/flex-challenges-for-flash-ide-devleopers/#comments</comments>
		<pubDate>Mon, 21 Jan 2008 00:08:32 +0000</pubDate>
		<dc:creator>george</dc:creator>
		
		<category><![CDATA[Flash CS3]]></category>

		<category><![CDATA[Flex 3]]></category>

		<guid isPermaLink="false">http://www.neatfilm.com/2008/01/20/flex-challenges-for-flash-ide-devleopers/</guid>
		<description><![CDATA[A post recalled myslef got frustrated last September, after several weeks honeymoon turning into Flex from Flash.

No doubt some developers from Flex community not easy to understand what&#8217;s the meaning when a Flash developer complaining (AS3 === AS3) = false, as the majority of Flex developers do not know too much about development in Flash [...]]]></description>
			<content:encoded><![CDATA[<p>A <a href="http://gfxcomplex.com/blog/as3/as3-as3-false-i-am-frustrated-with-the-flash-vs-flex-apis-and-the-bias-of-the-community/">post</a> recalled myslef <a href="http://www.neatfilm.com/2007/09/07/bored-to-code-in-flex-2/">got frustrated last September</a>, after several weeks honeymoon turning into Flex from Flash.</p>

<p>No doubt some developers from Flex community not easy to understand what&#8217;s the meaning when a Flash developer complaining <a href="http://gfxcomplex.com/blog/as3/as3-as3-false-i-am-frustrated-with-the-flash-vs-flex-apis-and-the-bias-of-the-community/">(AS3 === AS3) = false</a>, as the majority of Flex developers do not know too much about development in Flash IDE. The feeling of &#8217;second class citizens&#8217; for Flash developers in Flex development also could not make sense to some of them.</p>

<p>I would like to say, there&#8217;s no different AS3 language itself whatever Flash IDE or Flex, but the way of coding is wholly different and big changes for Flash developers when try to work with Flex.</p>

<p><strong>Rapid application development</strong></p>

<p>My favorite Flex blogger <a href="http://yakovfain.javadevelopersjournal.com/flex_best_practices_sketch_1_an_application_with_a_single_.htm">Yakov Fain</a> had a <a href="http://www.theriabook.com/">Flex and Java</a> book in 2006, Flex Builder was a &#8216;RAD tool&#8217; in that book, but some months later, a new post said &#8216;<a href="http://flexblog.faratasystems.com/?p=261">Flex 2 is not a RAD tool</a>&#8216; telling the real truth. He also questioned the usage of dominated Cairngorm framework for Flex applications.
Despite of some questions like these, however, Flex development is target to RAD. Although even today, the question asked by bosses &#8216;how to make a complex Flex application fast, extendable, fast UI change, great usabilities for every components and views, largely reusable classes to fit for different structures, tested fully with agile methods fast and easily, less developers and hours&#8217; still no one-fit-all answer, Flex teams are working the way into RAD at some percents.</p>

<p>The RAD nature of Flex making the big difference between Flash IDE applications and Flex applications, as Flash applications are more focus on Creative and User Experiences. Flash IDE projects are mostly like to be design-driven, with smooth workflow between designers and Flash IDE developers. While Flex application must largely adopt design patterns, restricted by components-base structure, agreement such as framework, patterns, coding style, between developers now and future.</p>

<p>Developing Flex applications, Flash IDE Developers have to learn more design patterns and structure frameworks, reading Flex SDK source code, get familiar with Flex components functions/events/behaviors, struggle with SDK bugs.</p>

<p><strong>Design challenges</strong></p>

<p>Early months before, I got impression from Adobe&#8217;s seminars/articles that, Flex framework is to give you a fast, powerful, extendable component-container collections, easy to change with CSS and bitmaps. And you can easily extend design with Flash IDE even. That&#8217;s not the truth in real world. That&#8217;s what talent Flash/Flex developer Jesse Warden talking about <a href="http://jessewarden.com/2008/01/when-you-hit-a-design-brick-wall-in-flex.html">design challenges</a>.</p>

<p>I used to have a former Flash IDE version of my Flex projects,  everything could be replaced with Flex components except a creation task with script-based animations. I found it&#8217;s not too hard to move the code base from Flash project into new Flex application, and feel happy in the beginning. But later when my bosses asked me to change something from time to time, I got some pains the needs of strong-typed communication functions between Flex framework and that low-level UIComponent-extended Flash component, split my brain into two parts, one thinking in Flash another thinking in Flex.</p>

<p><strong>Satisfaction
</strong></p>

<p>Most of workers working not only for money, but also for some sort of self-fulfillment, coming from satisfactions of his works. Flash IDE developers can get more or less satisfactions from Flash projects, where working with designers, whatever some sort of creatives and some sort of happiness.</p>

<p>Flash developers join into Flex projects will have less satisfactions. Each time when Adobe evangelist talking about how great a new Flex application is, someone will notice that &#8216;the best Flash applications in the industry still made with Flash IDE, not Flex&#8217;. Design challenges are limitations to make Flex to be satisfied like Flash applications, especially when designers have very limited experience working with Flex, even worse definitely no designer at all. Each time when the feeling comes, you &#8216;do not have the ability to make that happen which can be made with Flash easily&#8217;, can you feel it good?</p>

<p>Flex developers coming from Java or other languages getting satisfactions from Flex, as Flex applications he can build much beautiful than Java GUIs, HTML interfaces, and much easier. They&#8217;ve already have good experiences with enterprise design patterns, Flex is easy for them to dive into, and the results for them are amazing.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neatfilm.com/2008/01/20/flex-challenges-for-flash-ide-devleopers/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Koch curve AS3 experiment</title>
		<link>http://www.neatfilm.com/2007/10/22/koch-curve-as3-experiment/</link>
		<comments>http://www.neatfilm.com/2007/10/22/koch-curve-as3-experiment/#comments</comments>
		<pubDate>Tue, 23 Oct 2007 02:46:52 +0000</pubDate>
		<dc:creator>george</dc:creator>
		
		<category><![CDATA[Algorithms]]></category>

		<guid isPermaLink="false">http://www.neatfilm.com/2007/10/22/koch-curve-as3-experiment/</guid>
		<description><![CDATA[

A simple Koch curve experiment in AS3, port from Java version. Koch curve discovered by the Swedish mathematician Helge von Koch in 1904.

Origin Java code: Computer Graphics for Java Programmers by Leen Ammeraal and Kang Zhang

You can download AS3 source code to try: koch.zip .
]]></description>
			<content:encoded><![CDATA[<div class="caption left"><img src="http://www.neatfilm.com/post_images/07Oct/koch.jpg" /></div>

<p>A simple Koch curve experiment in AS3, port from Java version. Koch curve discovered by the Swedish mathematician Helge von Koch in 1904.</p>

<p>Origin Java code: <em>Computer Graphics for Java Programmers</em> by Leen Ammeraal and Kang Zhang</p>

<p>You can download AS3 source code to try: <a href="http://www.neatfilm.com/flash/download/Koch.zip">koch.zip</a> .</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neatfilm.com/2007/10/22/koch-curve-as3-experiment/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Cairngorm Or?</title>
		<link>http://www.neatfilm.com/2007/10/21/cairngorm-or/</link>
		<comments>http://www.neatfilm.com/2007/10/21/cairngorm-or/#comments</comments>
		<pubDate>Mon, 22 Oct 2007 02:06:54 +0000</pubDate>
		<dc:creator>george</dc:creator>
		
		<category><![CDATA[Flex 3]]></category>

		<guid isPermaLink="false">http://www.neatfilm.com/2007/10/21/cairngorm-or/</guid>
		<description><![CDATA[I picked up Cairngorm framework two weeks before as the requirements of my Flex projects changed for more flexibilities and Joe&#8217;s MVC blueprint structure I used no longer enough. Another reason was the excellent example network monitor came with the release of Flex Builder 3 beta 2. Last week some shouts suggested pureMVC as a [...]]]></description>
			<content:encoded><![CDATA[<p>I picked up <a href="http://labs.adobe.com/wiki/index.php/Cairngorm">Cairngorm</a> framework two weeks before as the requirements of my Flex projects changed for more flexibilities and Joe&#8217;s <a href="http://www.adobe.com/devnet/flex/articles/blueprint.html">MVC blueprint</a> structure I used no longer enough. Another reason was the excellent <a href="http://labs.adobe.com/wiki/index.php/Flex_3:Applications">example network monitor</a> came with the release of Flex Builder 3 beta 2. Last week some <a href="http://www.asserttrue.com/articles/2007/10/17/silvafug-application-frameworks-presentation">shouts</a> suggested <a href="http://puremvc.org/">pureMVC</a> as a better choice to Cairngorm framework. That&#8217;s good news for sure if pureMVC could really <a href="http://www.flashcomguru.com/index.cfm/2007/10/19/puremvc-kicks-butt">challenge</a> the dominating Cairngorm framework.</p>

<p>I don&#8217;t have time and enough experiences to discuss these two frameworks, here just my early thoughts about Cairngorm.</p>

<p><strong>Binding</strong></p>

<p>The most interest point of Cairngorm framework, for me, is its usage of <a href="http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Book_Parts&#038;file=databinding_091_02.html">binding</a>. I did not trained myself for Flex development but more comfortable with CS3 Flash Player classes, so I knew very few about Flex mx.binding and in the beginning I have only one week (actually two weeks and non-paid weekend/night to refactor several projects from Flash CS3, I should thanks for Joe&#8217;s MVC blueprint which I could use perfectly without any pain). When I began a new Flex project with Cairngorm framework this month, Cairngorm unlocked for me.</p>

<p>I faced a big challenge in Flex development for a long period, was to set values for components. The problem is, when a screen (such as a state inside a view, a child screen inside a ViewStack) was loaded, you cannot always set values for components in the time you want to, they might be &#8216;null or undefined object&#8217; or else, or simply data models not ready for you. In my projects, almost all components values in a screen have to get from server at runtime, with several requests in parallel AND in sequence, some screens even will change states because of server data received, and WHEN those responses come back, unknown. So often when I was going to set a component such as this.screen.username.text = &#8217;something&#8217;, I got a RTE &#8216;a null or undefined object&#8217;, or other troubles. A few complex screens could make this problem more complicated, such as revisit a screen has some logic of data changes, I have to code very carefully, save/restore data in data models and worried about when I could update those data in the screen, use saved values or data from server, bored and frustrated.</p>

<p>Cairngorm use the built-in binding feature very smart. It stores data models as bindable properties which can be accessed with ModelLocater static class, and components&#8217; values in a screen can be binded(watching I prefer to say) to these properties. A benefit of this, even these properties were null, it wouldn&#8217;t give a RTE on those components but simply display nothing. Once these properties were updated, maybe parsing responses from server, it will be displayed immediately on the screens. Simply, it make the Flex framework work for you.</p>

<p><strong>Cairngorm Framework is not Prison</strong></p>

<p>Although Cairngorm introduced a clear architecture for Flex projects, and it has been very popular for many companies as an agreement between developers in teamwork of Flex projects, one thing still true, it&#8217;s not everything about architecture. As you can see, from Cairngorm blogs, documentations and examples, you couldn&#8217;t get a full guide how to structure your own large applications with Cairngorm in one week.</p>

<p>I met some challenges when I tried to use Cairngorm events/commands/service structure, I googled quite a lot cases other developers experienced and their solutions(rare informations), I think in my case, to use events structure for a major parts of projects are not fit, but simply a stupid way. Using Joe&#8217;s MVC services/controller structure, I wrote only several classes with a large list of functions and they have been reused quite well. But if I rewrite them into events/commands, I will simply waste my days/weeks and introduce bugs. Design patterns are good to use, but overuse design patterns also not the deal. Design patterns should improve effectiveness now or later. Cairngorm framework is just an implementation of some design patterns, if you find some parts not fit your current project, you should try to find your own solutions with other patterns but not to be a prisoner of framework.</p>

<p><strong>Or pureMVC?</strong></p>

<p>I don&#8217;t have time to try pureMVC yet. I had a glance on pureMVC website and documents. One thing I not so agree with pureMVC&#8217;s goal is, a framework cannot be suitable both for Flash and Flex. I think a success Flex application framework must know quite well the Flex framework structures, get benefits from Flex framework itself, avoid some traps such as memory leaks. But a Flash framework will be a low-level framework of Flash platform to work directly with Flash player API, shouldn&#8217;t be the same as Flex project, should care more about Garbage collection optimization than Flex projects. We can use the same principles of MVC or others both in Flash and Flex projects, but not a single version of framework.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neatfilm.com/2007/10/21/cairngorm-or/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Flash or Flex or Both?</title>
		<link>http://www.neatfilm.com/2007/09/23/flash-or-flex-or-both/</link>
		<comments>http://www.neatfilm.com/2007/09/23/flash-or-flex-or-both/#comments</comments>
		<pubDate>Mon, 24 Sep 2007 05:22:35 +0000</pubDate>
		<dc:creator>george</dc:creator>
		
		<category><![CDATA[Flash CS3]]></category>

		<category><![CDATA[Flex 3]]></category>

		<guid isPermaLink="false">http://www.neatfilm.com/2007/09/23/flash-or-flex-or-both/</guid>
		<description><![CDATA[Last year lots of Flash developers wouldn&#8217;t think Flex 2 is suitable for web applications - longer loading time because of the size of Flex framework. Things changing at least recently, some big companies began to use Flex applications on their website officially, Yahoo!, Philips. I guess it partly because Adobe promised them before announcing [...]]]></description>
			<content:encoded><![CDATA[<p>Last year lots of Flash developers wouldn&#8217;t think Flex 2 is suitable for web applications - longer loading time because of the size of Flex framework. Things changing at least recently, some big companies began to use Flex applications on their website officially, Yahoo!, Philips. I guess it partly because Adobe promised them before announcing the Flex caching solution inside Flash player. So here comes a question, Flash or Flex, or both?</p>

<p><strong>Creative
</strong>Flash CS3 is sitting inside creative products list of Adobe, while Flex focus on enterprise solutions. It&#8217;s clear when you design/develop with Flash CS3, you have the most creative and freedom to do everything. A simple reason is, Flex actually a house of Flash,  a framework with a big collection of Flash classes. In the meaning of creative, you can do everything with Flash CS3 what Flex 2 can do. In Flex 2 you could also change components style, use bitmap images and Flash swfs to change skins and make them much friendly and beautiful. Though you have to do these with cautions in Flex - Flex has its own structures, listeners, display layers, rules.</p>

<p><strong>Development Speed</strong>
Last year when Adobe announced Flex 2, it was said &#8216;Flex is Fast&#8217;. Yes, make a Flex application within 5 minutes, make something magic with several classes, and you could change style and skins easily.
In real productive projects, it&#8217;s true for talent Java developers, while not true for Flash developers. Why? For Java developers, with Flex they don&#8217;t have to learn Flash drawing/timeline techniques, they can easily move Java code into Flex projects, and soon a nice business application, better then user interface with Java, styling and skinning, transitions and effects, and get benefits of high acceptance of Flash player, how cool and how fast it is!
But for Flash developers, why not the same? Simply, it depends. Flash developers will compare Flex applications to Flash web applications that talent designers made, will think about how to make better and perfect user experiences, how to make a beautiful transition that designers hope, will think this is not perfect enough I want to change, will have a favor to work with Flash player API classes, will like to customize Flex components here and there. And how to? If lucky you find a solution by searching google and Flexcoders mail list, or you have to find dig functions/events that you couldn&#8217;t find from examples of documents or books, worse you call some mx_internal properties, or push additional listeners for something because of &#8216;private&#8217; properties you have no right to change and dig their values, the worst, stop and wait somebody do that. A question is: why life is so hard in Flex? It SHOULD be several lines only to change in Flash AS3 classes but in Flex it have to go over more steps and more hours?
Honestly, if not so curious the way of Flash designers/developers, Flex applications could be faster than code in Flash(still depends, customers/managers may not satisfied, you have to make those hard parts happen). Be sure to walk on the road of Flex, you can be faster than walking on wild land, and, stop before the red sign.</p>

<p><strong>Performance</strong>
Although Flex was optimized quite much with Adobe&#8217;s own techniques, Flex will at least use more memory, extra listeners, extra resources that might useless for current project. When I opened more than 5 tabs of Flex applications in Firefox, in some case performance became a problem. Maybe they could be changed to &#8217;silent&#8217; - close listeners, clear garbages when browser window is changed to inactive.
<strong>
Testing</strong>
Flex is a Flash framework - tested. So you can get benefits from Flex, and save testing time and testers. If you want to make components in Flash the same Flex framework doing - I tried to do some of them before - wasting time. You have no much dedicated time and testers that Adobe engineers had.</p>

<p><strong>So, Flash or Flex?</strong>
I think these are for Flash only projects:
<ul>
    <li>Simple, clear structure, more creative.</li>
    <li>Games.</li>
    <li>No much standard forms, controls.</li>
</ul>
More likely Flex:
<ul>
    <li>Bunch of forms, standard controls.</li>
    <li>Stable and functions more important than eyes candy.</li>
</ul>
<strong>How about Both? </strong>
Flex of course has limitations of creative. Surely some projects need them work together, and get benefits from both side. There could be several methods to use them:
<ul>
    <li>Flash application to load Flex application on runtime, better user experience with Flash power and flexible.</li>
    <li>Flex application to load Flash application, some sort of.</li>
    <li>Flash UIMovieClip to be used inside Flex, works as a component.</li>
    <li>Flash CS AS3 classes extends UIComponents inside Flex, load symbols from Flash SWF file. I thought it&#8217;s hard before I tried this the first time, but find not so much.</li>
</ul></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neatfilm.com/2007/09/23/flash-or-flex-or-both/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Bored to code in Flex 2</title>
		<link>http://www.neatfilm.com/2007/09/07/bored-to-code-in-flex-2/</link>
		<comments>http://www.neatfilm.com/2007/09/07/bored-to-code-in-flex-2/#comments</comments>
		<pubDate>Sat, 08 Sep 2007 06:06:24 +0000</pubDate>
		<dc:creator>george</dc:creator>
		
		<category><![CDATA[Flex 3]]></category>

		<guid isPermaLink="false">http://www.neatfilm.com/2007/09/07/bored-to-code-in-flex-2/</guid>
		<description><![CDATA[Well, to day I already coded real productive projects 2 month with Flex Builder 2. I began to feel bored.

First of all, Flex builder 2 is not so mature product yet from a Flash developer&#8217;s perspective (compare to Flash IDE). Flex Builder 3 suppose to be. Flex 2 is perfect something for traditional Java developers, [...]]]></description>
			<content:encoded><![CDATA[<p>Well, to day I already coded real productive projects 2 month with Flex Builder 2. I began to feel bored.</p>

<p>First of all, Flex builder 2 is not so mature product yet from a Flash developer&#8217;s perspective (compare to Flash IDE). Flex Builder 3 suppose to be. Flex 2 is perfect something for traditional Java developers, they code quite a lot data-driven application and less time to work on UI, and not so curious about &#8216;Flash&#8217; user experience. But for Flash developers, Flex 2 SDK  is somehow a &#8216;formatted&#8217; framework, you don&#8217;t have too much freedom the way when you coding in Flash CS3.</p>

<p>Struggle with SDK &#8216;bugs&#8217; and searching/googling solution in a huge collection of documentations and Flex 2 SDK source code. As an experienced Flash coder, quite often I suppose a method of a Flex class should function this way, but no, yes often, not same as you wished. Sometime I could find a solution what I want to, maybe searching flexcoders, maybe go over Flex documentations, maybe check one or two classes of SDK source code. But when I couldn&#8217;t figure it out (wouldn&#8217;t have too much time to debug/check source code), I feel painful.</p>

<p>Bad feeling of code architecture. In Flash CS3, starting with a single Document class (root), I could have one or several trees of classes and everything easily to find. When to load a local configuration file, when to call remote server, when to draw Sprites, when get response from server and what should do based on it, synchronized or asynchronous. But in Flex it&#8217;s not everything in your hand. A mxml component will build its children itself, you have to find where you want to insert your functions into. A fresh Flex application could still clear although, after they were modified in design mode from time to time, mixed with several states, sometime its hard to find where the component is and I lost where to insert functions in my mxml files.</p>

<p>No strong community support especially Flex+Flash developers, not much really perfect Flex example projects(at least I didn&#8217;t see something really good as Flash). As far as I know, most of Flash developers came from designers, most of Flex developers came from hard code community such as Java coders, and, most of Flash developers today, I guess, still working on AS2. Also, I don&#8217;t know who&#8217;s on the top list of Flex developers. There&#8217;re a couple of Flex/AS3 books in Amazon, but not good enough though. What I think a Flex application should be? Well, if you make an application simliar with iPhone in Flex, I will say that&#8217;s a perfect one. I cannot do that, I don&#8217;t have time to be relax and code what I like to freely.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neatfilm.com/2007/09/07/bored-to-code-in-flex-2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Install Flash 9 player together with debugger in Ubuntu</title>
		<link>http://www.neatfilm.com/2007/08/18/install-flash-9-player-together-with-debugger-in-ubuntu/</link>
		<comments>http://www.neatfilm.com/2007/08/18/install-flash-9-player-together-with-debugger-in-ubuntu/#comments</comments>
		<pubDate>Sun, 19 Aug 2007 03:44:42 +0000</pubDate>
		<dc:creator>george</dc:creator>
		
		<category><![CDATA[Server]]></category>

		<guid isPermaLink="false">http://www.neatfilm.com/2007/08/18/install-flash-9-player-together-with-debugger-in-ubuntu/</guid>
		<description><![CDATA[I reinstalled my old D600 laptop with Ubuntu for server side coding/testing at home. Also I want to install Flash 9 player/debugger together.
Firefox is supported very well from Adobe, it could install Flash 9 player the same way as Windows. I downloaded Flash 9 debugger player and installed it as plugin for Firefox without any [...]]]></description>
			<content:encoded><![CDATA[<p>I reinstalled my old D600 laptop with Ubuntu for server side coding/testing at home. Also I want to install Flash 9 player/debugger together.
Firefox is supported very well from Adobe, it could install Flash 9 player the same way as Windows. I downloaded Flash 9 debugger player and installed it as plugin for Firefox without any problem. (Flash 9 debugger player together with <a rel="nofollow" href="http://www.sephiroth.it/">Alessandro Crugnola</a>&#8217;s Flash tracer extension of Firefox is a perfect runtime testing environment for Flash/Flex applications)</p>

<p>I need another browser with the regular Flash 9 player. This time I installed Opera.  I opened Opera it said Flash player was not installed. Good. I downloaded Flash 9 player for Linux package and tried to install it manually this time. But my surprise, the Flash player installer only try to install on .mozilla folder, it say &#8216;do you want to install another folder&#8217;, but no option for you to install to other folder, for me, I want to push them into Opera folder /usr/lib/opera. How can I do that so? (I don&#8217;t have time to change that shell installer.)</p>

<p>I checked opera/plugins/ folder. I guess maybe I could copy libflashplayer.so file directly over there. Ok let me try. I copy it (sudo required). Then open Opera. It works, cool!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neatfilm.com/2007/08/18/install-flash-9-player-together-with-debugger-in-ubuntu/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Rewrite Flash Application with Flex</title>
		<link>http://www.neatfilm.com/2007/07/29/rewrite-flash-application-with-flex/</link>
		<comments>http://www.neatfilm.com/2007/07/29/rewrite-flash-application-with-flex/#comments</comments>
		<pubDate>Mon, 30 Jul 2007 03:20:11 +0000</pubDate>
		<dc:creator>george</dc:creator>
		
		<category><![CDATA[Flex 3]]></category>

		<guid isPermaLink="false">http://www.neatfilm.com/2007/07/29/rewrite-flash-application-with-flex/</guid>
		<description><![CDATA[I&#8217;m working on a Flash application hard-coding with Actionscript 3. I used to make it in Flash CS3 (code with FlashDevelop of course). In the beginning everything looks perfect. With Flash CS3 I managed Sprite layers myself, I created lightweight buttons, labels, different kinds of data grids, radio buttons, comboBox, calendar, everything from scratch with [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working on a Flash application hard-coding with Actionscript 3. I used to make it in Flash CS3 (code with FlashDevelop of course). In the beginning everything looks perfect. With Flash CS3 I managed Sprite layers myself, I created lightweight buttons, labels, different kinds of data grids, radio buttons, comboBox, calendar, everything from scratch with code and symbols.
But problems coming up. My data grids have to support drag&#8217;n'drop here and there, and I find quite often I have to layout many a lot components, it&#8217;s a big headache to adjust position and size of components with actionscript directly. And I need many a lot hours to test with server API and dealing with up to ten kinds of server responses each view. I felt I need time to create drag&#8217;n'drop manager, popup manager, layout manager, transition manager classes. But I don&#8217;t have time before deadline!
So now, I have to rewrite it with Flex. Honestly, I hated Flex 2, I thought I would never have desire to play with Adobe/Macromedia components, I want to make every components myself, lightweight and special. But unfortunately, now I hug Flex.</p>

<p><strong>Flex is fast.</strong></p>

<p>I eat fast food quite often every week in Canada. I don&#8217;t have enough time to cook, so I eat fast food. Adobe said, Flex is fast. Oh well, truely fast, to run a Flex application on web wouldn&#8217;t be fast like Flash applications, but for development, it fast (or fast food).</p>

<p><strong>MXML vs AS</strong></p>

<p>I like pure actionscript code, quite neat architecture and easy to organize packages. MXML annoy me, I hate to mark Bindable here and there, but it have to admin, MXML make layout simple.</p>

<p><strong>Develop <em>Flash</em> Application with Flex</strong></p>

<p>I would say it&#8217;s good to design (even develop some) a Flex application with Flash first. Last weekend I surfed many online Flex applications, most of them are dry and &#8216;Flex-like&#8217;. Design with Flash before code with Flex, helped me to <em>Thinking in Flash</em> but not <em>Thinking in Flex</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neatfilm.com/2007/07/29/rewrite-flash-application-with-flex/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
