<?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>neatFilm.com &#187; ActionScript 3</title>
	<atom:link href="http://www.neatfilm.com/category/actionscript-3/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.neatfilm.com</link>
	<description></description>
	<lastBuildDate>Sun, 16 Oct 2011 05:21:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Simple Generic Object Pooling in AS3</title>
		<link>http://www.neatfilm.com/2011/10/15/simple-generic-object-pooling-in-as3/</link>
		<comments>http://www.neatfilm.com/2011/10/15/simple-generic-object-pooling-in-as3/#comments</comments>
		<pubDate>Sun, 16 Oct 2011 05:14:43 +0000</pubDate>
		<dc:creator>george</dc:creator>
				<category><![CDATA[ActionScript 3]]></category>

		<guid isPermaLink="false">http://www.neatfilm.com/?p=566</guid>
		<description><![CDATA[For Flash and Flex, object pooling is very important for performance, also an efficient way to avoid memory leak. Although many developers should have found good way to implement pooling, I unable to google a good one fitting my needs. So here&#8217;s my simple solution. You could find source code here: https://github.com/neatfilm/neatfilm.com-open-source-code/tree/master/com/neatfilm/framework/view Basically, a pool could [...]]]></description>
			<content:encoded><![CDATA[<p>For Flash and Flex, object pooling is very important for performance, also an efficient way to avoid memory leak. Although many developers should have found good way to implement pooling, I unable to google a good one fitting my needs. So here&#8217;s my simple solution.</p>

<p>You could find source code here: <a href="https://github.com/neatfilm/neatfilm.com-open-source-code/tree/master/com/neatfilm/framework/view">https://github.com/neatfilm/neatfilm.com-open-source-code/tree/master/com/neatfilm/framework/view</a></p>

<p>Basically, a pool could store any kinds of object (maybe sprite, UIComponent), as long as it implements IReusable interface.</p>

<ul>
    <li>function cloneNewObject():IReusable;</li>
    <li>function reset():void;</li>
</ul>

<p>Basically, the pool will be set with a single object as seed (also first object), any new object will be made by cloneNewObject() function, and stored in a single array. You can put object back, and first not-in-use object in the array will be picked when asking.</p>

<p>Outside of the object pool, you may set one or multiple array or/and dictionary to keep references of these objects for different purpose if necessary.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neatfilm.com/2011/10/15/simple-generic-object-pooling-in-as3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Develop / Debug Apps with Playbook</title>
		<link>http://www.neatfilm.com/2011/04/28/develop-debug-apps-with-playbook/</link>
		<comments>http://www.neatfilm.com/2011/04/28/develop-debug-apps-with-playbook/#comments</comments>
		<pubDate>Fri, 29 Apr 2011 06:43:44 +0000</pubDate>
		<dc:creator>george</dc:creator>
				<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Adobe AIR]]></category>

		<guid isPermaLink="false">http://www.neatfilm.com/?p=532</guid>
		<description><![CDATA[Playbook tablet apps can be developed with simulator, it can also run/debug with real playbook. The full check list to start develop Playbook App with Flash Builder is here: http://us.blackberry.com/developers/tablet/adobe.jsp Using simulator is the easiest way to debug apps, but with a few limitations. It would be a little bit fast to run tablet app in [...]]]></description>
			<content:encoded><![CDATA[<p>Playbook tablet apps can be developed with simulator, it can also run/debug with real playbook. The full check list to start develop Playbook App with Flash Builder is here: <a href="http://us.blackberry.com/developers/tablet/adobe.jsp">http://us.blackberry.com/developers/tablet/adobe.jsp</a></p>

<p>Using simulator is the easiest way to debug apps, but with a few limitations. It would be a little bit fast to run tablet app in the simulator. Unfortunately simulator is not free for Mac users, simulator has to be run in VMWare as guest OS, and VMware for Mac is not free (don&#8217;t know whether RIM would support the free VirtualBox in the future or not). A workaround that you could also install the simulator in another Windows or Linux PC, change simulator network setting from NAT to bridge mode, to allow connection between your development computer and simulator PC. The simulator itself need 1GB memory from your PC. If your development PC is not fast, consider a second PC to run the simulator.</p>

<p>Run/debug app directly in Playbook give you chance for a full test on your app in real environment, such as activate/deactivate, accelerometer, GPS location, maybe more.</p>

<p><strong>Signing</strong></p>

<p>To debug with Playbook, you must be authorized by RIM and create a debug token for the exact playbook. Complete the <a href="https://www.blackberry.com/SignedKeys/">signing keys</a> form, you&#8217;ll receive two .csj files usually in two workdays. With .csj files you can register with Flash Builder 4 or 4.5, then create a developer certificate so you could create debug tokens later(see image below).</p>

<p><a href="http://www.neatfilm.com/wp-content/uploads/2011/04/signing.png"><img class="size-medium wp-image-541 alignnone" title="signing" src="http://www.neatfilm.com/wp-content/uploads/2011/04/signing-300x196.png" alt="" width="300" height="196" /></a></p>

<p style="text-align: left;">Find your playbook PIN number About-&gt;Hardware,  you can create a debug token. Debug token would be a .bar file.</p>

<p style="text-align: left;">The playbook must be set with password, Security-&gt;Password, then change to development mode, Security-&gt;Development Mode. Then  upload the debug token to Playbook.</p>

<p style="text-align: left;"><strong>Configure App to debug with Playbook</strong></p>

<p style="text-align: left;">App to run/debug in Playbook must have same author(company name), author ID created in the debug token. If not match, when you try to run/debug, Playbook will give you an error. The author ID can be found in debug token details, from Flash Builder Preference -&gt; BlackBerry Tablet OS (for FB4) -&gt; Signing -&gt; Debug Tokens -&gt; Details.</p>

<p style="text-align: left;"><a href="http://www.neatfilm.com/wp-content/uploads/2011/04/token.png"><img class="aligncenter size-medium wp-image-542" title="token" src="http://www.neatfilm.com/wp-content/uploads/2011/04/token-300x225.png" alt="" width="300" height="225" /></a></p>

<p style="text-align: left;">&nbsp;</p>

<p style="text-align: left;"><strong>Create run/debug Configuration for Playbook</strong></p>

<p style="text-align: left;">Playbook apps will be compiled and deployed either in simulator or real playbook to debug. In Flash Builder 4 (new Flash Builder 4.5 may better on this) a debug configurations must be setup (and adjust for each app project). It would be exact same for simulator and playbook, except pointing to different device with different device IP address, as well as host IP address (host IP is the IP address in your develop computer, where the simulator/playbook could connect to your develop PC. For example, if Playbook IP is 10.0.1.x, your host IP should be the IP 10.0.1.x in your computer, you can find IP addresses with <em>ifconfig -a</em> in Mac, or <em>ipconfig /all|more</em> in Windows. If your simulator run in the same development PC, host IP would be different)</p>

<p style="text-align: left;">When you create a new app project, please remember to check run/debug configuration for the new project, otherwise Playbook may give you errors.</p>

<p style="text-align: left;"><a href="http://www.neatfilm.com/wp-content/uploads/2011/04/debug.png"><img class="aligncenter size-medium wp-image-540" title="debug" src="http://www.neatfilm.com/wp-content/uploads/2011/04/debug-300x237.png" alt="" width="300" height="237" /></a></p>

<p style="text-align: left;"><a href="http://www.neatfilm.com/wp-content/uploads/2011/04/debug.png"></a><strong>App Failed to run?</strong></p>

<p style="text-align: left;">It can happen sometime if your app configuration file, or your code not supported, or debug configuration incorrect, app will fail to run in Playbook, even worse, after an error happen, all apps in your Playbook would no longer able to run. You can try these if you run into trouble:</p>

<ul>
    <li>Check your blackberry-table.xml configuration file and debug configuration, try again.</li>
    <li>Try to uninstall the app first, try again.</li>
    <li>If Playbook not work properly, try to restart with the &#8220;Power Off&#8221; app.</li>
    <li>If &#8220;Power Off&#8221; couldn&#8217;t run (in this case, all apps fail to run), hold the power button to restart Playbook.</li>
</ul>

<p><strong>Playbook App Project</strong></p>

<p>Unlike Flash or Flex/Desktop AIR applications, Playbook apps must be run in simulator or real Playbook. It not worth to develop every piece of code and run that way (means compile, transfer to another place, then install, then start), which not so effective and waste lots of time.</p>

<p>Playbook AIR SDK has some parts such as web browser must use QNX packages, but UI could be built with Flex spark components or plain AS3 (no old MX components). Another concern most Flash/Flex team would like to develop a mobile app with one codebase and deploy in multiple OS systems,  so it would be better to separate the project into two type of projects:</p>

<ol>
    <li>One standard type Actionscript/Flex project(s), to develop UI as well as some functions, with mockups/test cases to maximize development tasks.</li>
    <li>Another BlackBerry Tablet app project, with shared code/library from #1 project, mainly develop Playbook-specific functions, as well as final tests.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.neatfilm.com/2011/04/28/develop-debug-apps-with-playbook/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Flex Interface Design with Scale9Grid Bitmap Class, another approach</title>
		<link>http://www.neatfilm.com/2009/02/10/flex-interface-design-with-scale9grid-bitmap-class-another-approach/</link>
		<comments>http://www.neatfilm.com/2009/02/10/flex-interface-design-with-scale9grid-bitmap-class-another-approach/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 07:07:43 +0000</pubDate>
		<dc:creator>george</dc:creator>
				<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[Flex SDK]]></category>

		<guid isPermaLink="false">http://www.neatfilm.com/?p=381</guid>
		<description><![CDATA[Recently I changed my job to part time, so got some spare time in my own project and some researches on Flex developments. I&#8217;m happy with that as I found more and more solutions in these days when I&#8217;m not pressed by full-time tasks as a major/lead developer and the only senior/firefighter for a team. [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I changed my job to part time, so got some spare time in my own project and some researches on Flex developments. I&#8217;m happy with that as I found more and more solutions in these days when I&#8217;m not pressed by full-time tasks as a major/lead developer and the only senior/firefighter for a team.</p>

<p>What I get most excited is getting some more ideas on interface design methods for Flex/AIR applications. I&#8217;m not a designer, most of my time focus on Flex/Flash coding and I constantly feel bad especially interface design in Flex. Not only Flex itself has no good work flow yet designers can easy to work, also it very hard for team/companies to find a really good designer for Flex projects.</p>

<p>Ok, I&#8217;m talking here is another optional approach in interface design for Flex. See follow I did in my own Flex/Air project:</p>

<p><img class="aligncenter" title="Scale9Bitmap" src="http://www.neatfilm.com/post_images/09Jan/bitmap_result.png" alt="" width="224" height="142" /></p>

<p>Have you seen somewhere like this? Well, I don&#8217;t have designer on my own project, but like good designs when I write codes and testing, so I &#8216;borrowed&#8217; some graphics from CS4 for use temperorily. It looks beautiful isn&#8217;t it? I hate any bad ugly designs in development, man, it&#8217;s <strong>Flash platform</strong>. I like beauties when I&#8217;m working and that&#8217;s why I choose to work as my career.</p>

<p><span style="color: #000000;"><strong>Requirements to make it?</strong></span></p>

<p>The example above I used three images:</p>

<ul>
    <li>left highlight skin image</li>
    <li>right skin image</li>
    <li>dropdown button image</li>
</ul>

<p>Scale9Grid bitmap class, you can get from <a href="http://www.bytearray.org/?p=118">bytearray.org</a>. (I made some small modifications so its Scale9Bitmap class in this example. May write a new UIComponent-based class myself from scratch later when have time.)</p>

<p><strong>How to make it?</strong></p>

<p>The example above is the dock header, each one is a single object based on UIComponent. I show here how to make the right skin inside that component.</p>

<p>createChildren function, load bitmap with url:</p>

<p><img class="aligncenter" title="scale9 create children" src="http://www.neatfilm.com/post_images/09Jan/createChildren.png" alt="" width="517" height="280" /></p>

<p>Complete handler:</p>

<p><img class="aligncenter" title="scale9 complete" src="http://www.neatfilm.com/post_images/09Jan/complete_handler.png" alt="" width="505" height="160" /></p>

<p>updateDisplayList function:</p>

<p><img class="aligncenter" title="scale 9 update display" src="http://www.neatfilm.com/post_images/09Jan/updateDisplay.png" alt="" width="482" height="128" /></p>

<p>The component wouldn&#8217;t create bitmap until loader complete, then insert into bottom layer as its the background image. (In this example I put another skin image above so it will be inserted into layer 1 when the bottom layer has already added, that&#8217;s why I use a flag _rightSkinLoaded.)</p>

<p>The bitmap wouldn&#8217;t renderer until invalidation display list is called, which make maximum performance based on Flex framework. In updateDisplayList function, two skin images will be scaled with scale9Grid rectangles, that&#8217;s where the magic happens.</p>

<p>There&#8217;s one more thing, to get best result in my example, scale 9 bitmaps works better when positioning in pixels, I use int(xx) as followed:</p>

<p><img class="aligncenter" title="bitmap scale 9 pixel" src="http://www.neatfilm.com/post_images/09Jan/bitmap_pixel.png" alt="" width="488" height="123" /></p>

<p><strong>Discussion</strong></p>

<p>There already lots of approaches for interface design/skinning, like Flex/CS4 skinning kits, Degrafa. These approaches &#8216;work&#8217; but I myself much like use scale9grid bitmap inside component directly. Here&#8217;s what I think:</p>

<ul>
    <li>Any designer can make graphics design, can support developers easy to use this approach, in case of scale 9 grid can work perfect (I think most standard interface components?).</li>
    <li>Degrafa can be hard to &#8216;code&#8217; graphics result what designer expect, but image with scale9 rectangle easy.</li>
    <li>Less code (code lines after compiling) and better performance. If there&#8217;s tons of components in your application, you have to take care of performance. If you can, don&#8217;t use CSS skins for highly reused components.</li>
    <li>Bitmap don&#8217;t need to be embedded, which make less size of application and less compiling time if there&#8217;s many bitmaps.</li>
</ul>

<p>Of course, this is just an optional approach for Flex interface design, as scale 9 slices may not work in some designs.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neatfilm.com/2009/02/10/flex-interface-design-with-scale9grid-bitmap-class-another-approach/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SQLite as Service in AIR (Flash/Flex)</title>
		<link>http://www.neatfilm.com/2009/01/23/sqlite-as-service-in-air-flashflex/</link>
		<comments>http://www.neatfilm.com/2009/01/23/sqlite-as-service-in-air-flashflex/#comments</comments>
		<pubDate>Fri, 23 Jan 2009 17:01:55 +0000</pubDate>
		<dc:creator>george</dc:creator>
				<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[Flash Professional IDE]]></category>
		<category><![CDATA[Flex SDK]]></category>

		<guid isPermaLink="false">http://www.neatfilm.com/?p=337</guid>
		<description><![CDATA[I introduce here is my approach (not fully complete framework), to use SQLite like an external service in AIR, in most simple way. The following code is how it to be used in Flash/Flex application: That simple? Sure it is. Don&#8217;t forget, in AIR applications, using SQLite we MUST use asynchronous connections for user experiences. [...]]]></description>
			<content:encoded><![CDATA[<p>I introduce here is my approach (not fully complete framework), to use SQLite like an external service in AIR, in most simple way.</p>

<p>The following code is how it to be used in Flash/Flex application:</p>

<p><img class="aligncenter" title="SQL code" src="http://www.neatfilm.com/post_images/09Jan/sqlite_code.png" alt="" width="449" height="201" /></p>

<p>That simple? Sure it is.</p>

<p>Don&#8217;t forget, in AIR applications, using SQLite we<strong> MUST use asynchronous connections</strong> for user experiences. The framework will do rest hard jobs for you.</p>

<p>Framework Features:</p>

<ul>
    <li>SQLConnection instances reused.</li>
    <li>SQLStatement instances reused.</li>
    <li>Statements executed in queue automatically, no extra control required.</li>
    <li>Dealing with SQLite locks inside framework.</li>
    <li>Feedback(result/fault) functions can be reused, similar with pureMVC&#8217;s handleNotifications.</li>
    <li>Support to run feedback functions not original object, i.e. a view sent a query then closed, after query complete, run feedback function in another object/view.</li>
    <li>All statement/connection objects managed and resources can be cleaned.</li>
</ul>

<p><img class="aligncenter" title="Sqlite workflow" src="http://www.neatfilm.com/post_images/09Jan/workflow.png" alt="" width="441" height="235" /></p>

<p><strong>SQLite Performance Best Practices
</strong></p>

<p>It&#8217;s important to get benefit of maximum performance of database, SQLite has its own specifications. One of them, Adobe has already documented, is the cached statements, cached statements can be reused and increase performance largely.</p>

<p>The second one, I didn&#8217;t see anyone mentioned it (maybe I missed), is the lock system of SQLite.</p>

<p>SQLite has a special lock system, have a look the figure followed:</p>

<p><img class="aligncenter" title="Sqlite lock" src="http://www.neatfilm.com/post_images/09Jan/sqlite_lock.png" alt="" width="476" height="303" /></p>

<p>Here&#8217;s several important rules about SQLite lock system:</p>

<ul>
    <li>A connection can have only one transaction (working statement) at a time.</li>
    <li>SQLite can have multiple read transactions(read statement) and one single write transaction(write statement) at the same time.</li>
    <li>When the write transaction working or waiting, no more new connections can work.</li>
    <li>The waiting write transaction will be executed only after all other read transactions complete.</li>
</ul>

<p>The third one, using SQLTransactionLockType.IMMEDIATE for write transaction can improve performance when necessary.</p>

<p>My solution implement first and second, the last one I didn&#8217;t find a good solution to use it in <strong>asynchronous connection mode</strong>, will talk it later.</p>

<p><strong>Framework Structure</strong></p>

<p><img class="aligncenter" title="SQLite framework structure" src="http://www.neatfilm.com/post_images/09Jan/structure.png" alt="" width="359" height="266" /></p>

<p>The framework include three major classes:</p>

<ul>
    <li>SQLManager</li>
    <li>ConnectionPool, manage and reuse connections for statements.</li>
    <li>StatementManager, add/remove statements.</li>
</ul>

<p><img class="aligncenter" title="SQLite classes" src="http://www.neatfilm.com/post_images/09Jan/classes.png" alt="" width="371" height="226" /></p>

<p>These object classes/interface used by the framework:</p>

<ul>
    <li>SQLiteStatement, after an operation finished, it run feedback based on caller and function(string). Feedback function can be different to the original view(object).</li>
    <li>SQLiteConnection</li>
    <li>CachedStatement, statement cannot to be run immediately will be cached as a CachedStatement in waiting list.</li>
    <li>ISQLResponder, optional interface for caller view/object.</li>
</ul>

<p><strong>Framework workflow</strong></p>

<ul>
    <li>Create instance for a database file (file can not exist even)</li>
    <li>Add statements when needed, statements will be initialized.</li>
    <li>View call for execute one or several statements with statement_id, set result/fault function, and flag whether need to ignore fault (if ignore, sqlite will continue to run waiting statements)</li>
    <li>SQLManager get statement instance, or cache your request to a waiting list if already used.</li>
    <li>SQLManager ask ConnectionPool to apply a SQLiteConnection for statement to execute.</li>
    <li>Statement try to execute, if SQLConnection not connected, waiting for that connection and execute.</li>
    <li>Statement completed/fault, call feedback function with statement_id (if asked), and execute next waiting statement if exist.</li>
</ul>

<p>The framework keep minimum instances of SQLConnection and SQLStatement, and easy to be removed as they&#8217;re managed for garbage collection.</p>

<p>I&#8217;m not going to publish source code right now as it&#8217;s not a complete framework yet.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neatfilm.com/2009/01/23/sqlite-as-service-in-air-flashflex/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>MenuBar Skinning</title>
		<link>http://www.neatfilm.com/2009/01/19/menubar-skinning/</link>
		<comments>http://www.neatfilm.com/2009/01/19/menubar-skinning/#comments</comments>
		<pubDate>Mon, 19 Jan 2009 07:25:40 +0000</pubDate>
		<dc:creator>george</dc:creator>
				<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Flex SDK]]></category>

		<guid isPermaLink="false">http://www.neatfilm.com/?p=325</guid>
		<description><![CDATA[The default menubar looks quite bad, I used half day to google and skin it. Ok, the result looks not too bad. Take out top menu item background. Add filter to top item label. Change top item rollover background. Set minimum width for top item. Set minimum width for drop down menu. Skinning for dropdown [...]]]></description>
			<content:encoded><![CDATA[<p>The default menubar looks quite bad, I used half day to google and skin it. Ok, the result looks not too bad.</p>

<p><img class="aligncenter" title="MenuBar" src="http://www.neatfilm.com/post_images/09Jan/menubar.png" alt="" width="511" height="238" /></p>

<ul>
    <li>Take out top menu item background.</li>
    <li>Add filter to top item label.</li>
    <li>Change top item rollover background.</li>
    <li>Set minimum width for top item.</li>
    <li>Set minimum width for drop down menu.</li>
    <li>Skinning for dropdown menu in CSS.</li>
</ul>

<p>Full example source code download <a href="http://www.neatfilm.com/flash/download/MenuBarSkin.zip">here</a>.</p>

<p>File list:</p>

<ul>
    <li>MenuBarSkin.mxml, with menu style and menuBar style especially fillColors, fillAlphas.</li>
    <li>AppMenuBar.as, extend MenuBar class, getMenuAt() to set minimum width for drop-down menu, updateBackground() was to remove the background.</li>
    <li>AppMenuItem.as, extend MenuBarItem, set top item label dropshadow filter and set minimum width for top item.</li>
    <li>MenuItemSkin.as, replace default up/down/over halo skin.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.neatfilm.com/2009/01/19/menubar-skinning/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple Flash CS4-style Docking in Flex</title>
		<link>http://www.neatfilm.com/2009/01/08/simple-flash-cs4-style-docking-in-flex/</link>
		<comments>http://www.neatfilm.com/2009/01/08/simple-flash-cs4-style-docking-in-flex/#comments</comments>
		<pubDate>Fri, 09 Jan 2009 00:37:21 +0000</pubDate>
		<dc:creator>george</dc:creator>
				<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[Flex SDK]]></category>
		<category><![CDATA[flash flex docking]]></category>

		<guid isPermaLink="false">http://www.neatfilm.com/?p=299</guid>
		<description><![CDATA[Inspired by Degrafa, I spent couple of days to build a quick docking manager. It can add any component/containers into the list dynamically. Full source code download here. My working project with this docking manager:]]></description>
			<content:encoded><![CDATA[<p>Inspired by Degrafa, I spent couple of days to build a quick docking manager. It can add any component/containers into the list dynamically.</p>

<p>Full source code download <a href="http://www.neatfilm.com/flash/download/DockExample.zip">here</a>.</p>

<p style="text-align: center;"><img class="aligncenter" title="Docking" src="http://www.neatfilm.com/post_images/09Jan/dock.png" alt="" width="290" height="443" /></p>

<p style="text-align: left;">My working project with this docking manager:</p>

<p style="text-align: center;"><img class="aligncenter" title="Docking" src="http://www.neatfilm.com/post_images/09Jan/dock2.png" alt="" width="421" height="384" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neatfilm.com/2009/01/08/simple-flash-cs4-style-docking-in-flex/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>AIR Mac-only Crashes</title>
		<link>http://www.neatfilm.com/2008/12/10/air-mac-only-crashes/</link>
		<comments>http://www.neatfilm.com/2008/12/10/air-mac-only-crashes/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 05:14:55 +0000</pubDate>
		<dc:creator>george</dc:creator>
				<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[Flex SDK]]></category>

		<guid isPermaLink="false">http://www.neatfilm.com/?p=290</guid>
		<description><![CDATA[The team I recently working with mainly developing AIR application on Windows Vista, our designers using Macs though. AIR can be run both on Windows and Mac, but we experienced several Mac-only crashes. We have several Flex developers, I have to use some of my time review code for other developers even rewriting some of [...]]]></description>
			<content:encoded><![CDATA[<p>The team I recently working with mainly developing AIR application on Windows Vista, our designers using Macs though. AIR can be run both on Windows and Mac, but we experienced several Mac-only crashes.</p>

<p>We have several Flex developers, I have to use some of my time review code for other developers even rewriting some of buggy code. The designer working on Flex Builder for skinning will run the application on his Mac a few days a month, until he ran Flex Builder we knew the application got crash on Mac. I had to use several hours to find and fix the problem. A month and more later he opened his FB again and the application crash again.</p>

<p><strong>Crash Reasons?</strong></p>

<p>Totally three Mac-only crashes I fixed. Now I work remotely at home and using my own Macbook so there will no more &#8216;silent&#8217; Mac-only crash will happen. Here&#8217;s reasons I found which caused Mac-only crashes:</p>

<ul>
    <li>SQLite database object AMF3 <em>deserialization</em>, in a special case of object serialized with a single object to be stored several times into database table.</li>
    <li>A fault application menu was added.</li>
    <li>SQLite database, a write transaction was added into a function which has several read transactions running in parallel. Also, it seems several &#8216;select all&#8217; read transactions at the same time cause occasionally crash as well.</li>
</ul>

<p><strong>Avoid Mac-only Crashes</strong></p>

<ul>
    <li>If application need to be run on Mac, <strong>have at least one developer working on Mac</strong>.
Fixing a Mac-only bug after several weeks is hard than regular bugs. For agile development, bug should be find as soon as possible, if a month later find application cannot be run on Mac, a senior developer have to use at least several hours if unlucky.</li>
    <li>Be careful when working on <strong>SQLite database</strong>.
The first crash was because of an unsafe usage of reference, reuse a single object reference sometime cause unknown issues like this; for 3rd crash, although SQLite can have a single write transaction to be run at the same time of several read transactions, as &#8216;writer&#8217; will wait for an exclusive lock until all &#8216;readers&#8217; complete, SQLite engine inside AIR might not handler it correctly, at least on Mac.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.neatfilm.com/2008/12/10/air-mac-only-crashes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>AIR 1.5, SQlite now encrypted.</title>
		<link>http://www.neatfilm.com/2008/11/17/air-15-sqlite-now-encrypted/</link>
		<comments>http://www.neatfilm.com/2008/11/17/air-15-sqlite-now-encrypted/#comments</comments>
		<pubDate>Mon, 17 Nov 2008 16:59:28 +0000</pubDate>
		<dc:creator>george</dc:creator>
				<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Adobe AIR]]></category>

		<guid isPermaLink="false">http://www.neatfilm.com/?p=277</guid>
		<description><![CDATA[I have a long time searching for security on SQLite database, as far as I know encryption was a commercial extension for SQLite and not sure whether Adobe will implement it for AIR SQlite engine. It really a great news now Adobe AIR 1.5 support encrypted SQLite database. Thanks, Adobe AIR team. Using encryption with [...]]]></description>
			<content:encoded><![CDATA[<p>I have a long time searching for security on SQLite database, as far as I know encryption was a commercial extension for SQLite and not sure whether Adobe will implement it for AIR SQlite engine. It really a great news now Adobe AIR 1.5 support encrypted SQLite database. Thanks, Adobe AIR team.</p>

<p><a href="http://help.adobe.com/en_US/AIR/1.5/devappsflex/WS8AFC5E35-DC79-4082-9AD4-DE1A2B41DAAF.html">Using encryption with SQL databases</a></p>

<p><a href="http://www.adobe.com/devnet/logged_in/rchristensen_lpolanco_air_1.5.html">Introducing Adobe AIR 1.5</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neatfilm.com/2008/11/17/air-15-sqlite-now-encrypted/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>AS3 Obfuscation and Decompiler Test</title>
		<link>http://www.neatfilm.com/2008/09/27/as3-obfuscation-and-decompiler-test/</link>
		<comments>http://www.neatfilm.com/2008/09/27/as3-obfuscation-and-decompiler-test/#comments</comments>
		<pubDate>Sat, 27 Sep 2008 21:22:47 +0000</pubDate>
		<dc:creator>george</dc:creator>
				<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[Flash Professional IDE]]></category>
		<category><![CDATA[Flex SDK]]></category>

		<guid isPermaLink="false">http://www.neatfilm.com/?p=225</guid>
		<description><![CDATA[Shocked by Doug Mccuue&#8217;s post, I decided to have a test on obfuscation and decompiler together, to see how safe my own Flex/Air code bases. SWF Encrypt For a long time I was impressed by SWF Encrypt, although it&#8217;s not a real encryption, should be something interest if it can obfuscate code well for me. [...]]]></description>
			<content:encoded><![CDATA[<p>Shocked by <a href="http://dougmccune.com/blog/2008/09/27/if-you-steal-source-code-dont-ask-for-help-fixing-it/">Doug Mccuue&#8217;s post</a>, I decided to have a test on obfuscation and decompiler together, to see how safe my own Flex/Air code bases.</p>

<p><strong><a href="http://www.amayeta.com/software/swfencrypt/">SWF Encrypt</a></strong></p>

<p>For a long time I was impressed by SWF Encrypt, although it&#8217;s not a real encryption, should be something interest if it can obfuscate code well for me.</p>

<p><strong><a href="http://www.sothink.com/product/flash-decompiler-for-mac/index.htm">Sothink Decompiler</a></strong></p>

<p>In AS2 days I used to use the free <a href="http://www.nowrap.de/flare.html">Flare</a> written by Igor Kogan, it was a great tool to help to search where co-workers hide their code inside FLA files. But now I need a AS3 version it no longer support. I read a post by Lee Brimelow <a href="http://theflashblog.com/?p=391">about Sothink decompler</a> several months before, so I would like to give it a try.</p>

<p><strong>Test</strong></p>

<p>SWF Encrypt trial version let me try 25 times, I made a secure swf from my AIR swf file.</p>

<p>Sothink Decompiler can read my origin AIR swf file easily, include almost all assets and code packages. Unfortunately the trial version do not let me check source code.</p>

<p>I found code structure in Sothink quite clear and accurate matching my own code base. I decided to buy it as the price not a problem $79.</p>

<p><strong>Result</strong></p>

<p>From my original AIR swf file, Sothink can read almost all my code, that&#8230;.hell!</p>

<p>From secure AIR swf file, Sothink again, read most of my code, only several properties and function names hide.</p>

<p><strong>Conclusion</strong></p>

<p>First, the dark side, our code is definitely not safe.</p>

<p>Second, I do not feel SWF Encrypt doing its own job, I hope it can at least change my property/function names so even decompilers can take out all code, still hard to understand. SWF Encrypt really hide several properties/function names, but only very few of them.</p>

<p><span style="text-decoration: line-through;">Third, I found Sothink useful. Flex framework itself is a giant code base, Sothink decompiler code give some other code we cannot see and realize in MXML files.</span></p>

<p>Update: finty is right. I forgot Flex compiler can generate source code itself.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neatfilm.com/2008/09/27/as3-obfuscation-and-decompiler-test/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<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[ActionScript 3]]></category>
		<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[Flex SDK]]></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 [...]]]></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:</p>

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

<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">SyslogService.log(SyslogLevel.INFO, 'Application start.');</div></div>

</li>
</ul>
</li>
    <li>If statement is executing, push log data into stack and insert after.</li>
</ul>

<p>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;">

<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">if(!sqlConnection.connected)</div></div>

</p>

<p style="padding-left: 60px;">

<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sqlConneciton.addEventListener ...</div></div>

</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>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

