<?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>Words, punctuated &#187; AS3</title>
	<atom:link href="http://probertson.com/articles/category/actionscript/three/feed/" rel="self" type="application/rss+xml" />
	<link>http://probertson.com</link>
	<description>Thoughts on web development, user-centered design, code, etc. by Paul Robertson</description>
	<lastBuildDate>Tue, 20 Jul 2010 21:29:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Simple ActionScript 3 animation examples</title>
		<link>http://probertson.com/articles/2010/07/20/simple-actionscript-3-animation-examples/</link>
		<comments>http://probertson.com/articles/2010/07/20/simple-actionscript-3-animation-examples/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 16:20:34 +0000</pubDate>
		<dc:creator>Paul Robertson</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Animation]]></category>
		<category><![CDATA[Articles by Paul]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://probertson.com/?p=449</guid>
		<description><![CDATA[Last week I spent a little time teaching some of the newer developers in our office about scripted animation in ActionScript 3. I put together a few simple demos for them, and I thought I might as well share them with the world.
Note that these are basic demos so if you know pretty much anything [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I spent a little time teaching some of the newer developers in our office about scripted animation in ActionScript 3. I put together a few simple demos for them, and I thought I might as well share them with the world.</p>
<p>Note that these are basic demos so if you know pretty much anything about animation in ActionScript, these may not teach you anything.</p>
<p>All these scripts do pretty much the same thing. They draw a square on the stage. When you click on it, it moves horizontally from x=100 to x=400. Each of these is a class that you can run as the main class of an AS3 application.</p>
<h2>1. The wrong way</h2>
<p>The wrong way, of course, is to use a for loop:</p>
<pre class="brush:actionscript3">package
{
    import flash.events.Event;
    import flash.events.MouseEvent;
    import flash.display.Sprite;
    public class BasicAnimation extends Sprite
    {
        // ------- Constructor -------

        public function BasicAnimation()
        {
            _createChildren();
        }

        // ------- Child display objects -------

        private var _rect:Sprite;

        // ------- Private constants -------

        private const START:int = 100;
        private const END:int = 400;

        // ------- Private methods -------

        private function _createChildren():void
        {
            _rect = new Sprite();
            _rect.graphics.beginFill(0xff0000, 1);
            _rect.graphics.drawRect(0, 0, 100, 100);
            _rect.graphics.endFill();
            _rect.x = START;
            addChild(_rect);
            _rect.addEventListener(MouseEvent.CLICK, _rect_click);
        }

        // ------- Event handling -------

        private function _rect_click(event:MouseEvent):void
        {
            // wrong way:
            _rect.x = START;
            while (_rect.x < END)
            {
                _rect.x++;
            }
        }
    }
}</pre>
<h2>The right way (most basic)</h2>
<p>Of course, this one runs very slow since it&#8217;s moving at a rate of 1 pixel per frame.</p>
<pre class="brush:actionscript3">package
{
    import flash.events.Event;
    import flash.events.MouseEvent;
    import flash.display.Sprite;
    public class BasicAnimation extends Sprite
    {
        // ------- Constructor -------

        public function BasicAnimation()
        {
            _createChildren();
        }

        // ------- Child display objects -------

        private var _rect:Sprite;

        // ------- Private constants -------

        private const START:int = 100;
        private const END:int = 400;

        // ------- Private methods -------

        private function _createChildren():void
        {
            _rect = new Sprite();
            _rect.graphics.beginFill(0xff0000, 1);
            _rect.graphics.drawRect(0, 0, 100, 100);
            _rect.graphics.endFill();
            _rect.x = START;
            addChild(_rect);
            _rect.addEventListener(MouseEvent.CLICK, _rect_click);
        }

        // ------- Event handling -------

        private function _rect_click(event:MouseEvent):void
        {
            // right way (very basic):
            addEventListener(Event.ENTER_FRAME, _enterFrameBasic);
        }

        private function _enterFrameBasic(event:Event):void
        {
            if (_rect.x < END)
            {
                _rect.x++;
            }
            else
            {
                removeEventListener(Event.ENTER_FRAME, _enterFrameBasic);
            }
        }
    }
}</pre>
<h2>Adding velocity as a variable</h2>
<p>The solution to the slowness is to add a velocity variable. The value (in units of pixels per frame) will determine how quickly the animation moves. Basically you just try different values until you&#8217;re happy with something. Like the previous example, this is a purely linear animation &#8212; the velocity stays constant.</p>
<pre class="brush:actionscript3">package
{
    import flash.events.Event;
    import flash.events.MouseEvent;
    import flash.display.Sprite;
    public class BasicAnimation extends Sprite
    {
        // ------- Constructor -------

        public function BasicAnimation()
        {
            _createChildren();
        }

        // ------- Child display objects -------

        private var _rect:Sprite;

        // ------- Private constants -------

        private const START:int = 100;
        private const END:int = 400;

        // ------- Private methods -------

        private function _createChildren():void
        {
            _rect = new Sprite();
            _rect.graphics.beginFill(0xff0000, 1);
            _rect.graphics.drawRect(0, 0, 100, 100);
            _rect.graphics.endFill();
            _rect.x = START;
            addChild(_rect);
            _rect.addEventListener(MouseEvent.CLICK, _rect_click);
        }

        // ------- Event handling -------

        private function _rect_click(event:MouseEvent):void
        {
            // right way (very basic):
            addEventListener(Event.ENTER_FRAME, _enterFrameBasic);
        }

        private function _enterFrameBasic(event:Event):void
        {
            if (_rect.x < END)
            {
                var velocity:int = 5;
                _rect.x += velocity;
            }
            else
            {
                removeEventListener(Event.ENTER_FRAME, _enterFrameBasic);
            }
        }
    }
}</pre>
<h2>Adding acceleration</h2>
<p>Once you&#8217;ve separated out velocity, it becomes easy to make the animation non-linear by adding an acceleration value that causes the velocity to change over time. We&#8217;re just stepping back one level of complexity &#8212; the acceleration is now linear instead of the velocity.</p>
<pre class="brush:actionscript3">package
{
    import flash.events.Event;
    import flash.events.MouseEvent;
    import flash.display.Sprite;
    public class BasicAnimation extends Sprite
    {
        // ------- Constructor -------

        public function BasicAnimation()
        {
            _createChildren();
        }

        // ------- Child display objects -------

        private var _rect:Sprite;

        // ------- Private constants -------

        private const START:int = 100;
        private const END:int = 400;

        // ------- Private methods -------

        private function _createChildren():void
        {
            _rect = new Sprite();
            _rect.graphics.beginFill(0xff0000, 1);
            _rect.graphics.drawRect(0, 0, 100, 100);
            _rect.graphics.endFill();
            _rect.x = START;
            addChild(_rect);
            _rect.addEventListener(MouseEvent.CLICK, _rect_click);
        }

        // ------- Event handling -------

        private function _rect_click(event:MouseEvent):void
        {
            // right way (very basic):
            addEventListener(Event.ENTER_FRAME, _enterFrameBasic);
        }

        private var _velocity:int = 0;

        private function _enterFrameBasic(event:Event):void
        {
            if (_rect.x < END)
            {
                var accel:int = 3;
                _velocity += accel;
                _rect.x += _velocity;
            }
            else
            {
                removeEventListener(Event.ENTER_FRAME, _enterFrameBasic);
            }
        }
    }
}
</pre>
<h2>Interpolating values over time</h2>
<p>This next example doesn&#8217;t build on the previous ones but instead takes a completely separate approach to creating animation. This animation is time-driven rather than frame-driven. Instead of adding a particular number of pixels to the x value each frame, it calculates how much time has elapsed since the start and what the x value should be at that moment in time, then sets the x property to that value. A consequence of this approach is that regardless of the frame rate of the SWF, the animation will always last the same amount of time.</p>
<pre class="brush:actionscript3">package
{
    import flash.utils.getTimer;
    import flash.events.Event;
    import flash.events.MouseEvent;
    import flash.display.Sprite;
    public class AnimationIntermediate extends Sprite
    {
        // ------- Constructor -------

        public function AnimationIntermediate()
        {
            _createChildren();
        }

        // ------- Child display objects -------

        private var _rect:Sprite;

        // ------- Private constants -------

        private const START:int = 100;
        private const END:int = 400;
        private const TOTAL_TIME:int = 5000;

        // ------- Private methods -------

        private function _createChildren():void
        {
            _rect = new Sprite();
            _rect.graphics.beginFill(0xff0000, 1);
            _rect.graphics.drawRect(0, 0, 100, 100);
            _rect.graphics.endFill();
            _rect.x = START;
            addChild(_rect);
            _rect.addEventListener(MouseEvent.CLICK, _rect_click);
        }

        // ------- Event handling -------

        private var _startTime:int = 0;

        private function _rect_click(event:MouseEvent):void
        {
            // right way (intermediate):
            _startTime = getTimer();
            addEventListener(Event.ENTER_FRAME, _enterFrameIntermediate);
        }

        private function _enterFrameIntermediate(event:Event):void
        {
            var elapsedTime:int = getTimer() - _startTime;
            var fractionComplete:Number = elapsedTime / TOTAL_TIME;

            if (fractionComplete < 1)
            {
                var totalDistance:int = END - START;
                var offset:int = Math.round(fractionComplete * totalDistance);
                _rect.x = START + offset;
            }
            else
            {
                _rect.x = END;
                removeEventListener(Event.ENTER_FRAME, _enterFrameIntermediate);
            }
        }
    }
}</pre>
<p>The main point of this example is to demonstrate the idea that you can plug in an algorithm that calculates position given time, and by varying the algorithm you can vary the animation. This is a direct lead-in to the idea of using tweening functions to vary an animation, as demonstrated in the next example.</p>
<h2>Using an animation library</h2>
<p>This example shows the use of a third-party animation library (in this case Grant Skinner&#8217;s <a href="http://www.gskinner.com/libraries/gtween/">GTween</a> library). The commented-out lines demonstrate how a library makes it easy to synchronize animation and vary the animation. Note that this is only meant as a very basic demonstration of the concept of using a library for animation &#8212; GTween and the many other animation libraries that are out there all provide many additional features.</p>
<pre class="brush:actionscript3">package
{
    import com.gskinner.motion.easing.Bounce;
    import com.gskinner.motion.easing.Sine;
    import com.gskinner.motion.GTween;
    import flash.events.MouseEvent;
    import flash.display.Sprite;
    public class AnimationTween extends Sprite
    {
        // ------- Constructor -------

        public function AnimationTween()
        {
            _createChildren();
        }

        // ------- Child display objects -------

        private var _rect:Sprite;

        // ------- Private constants -------

        private const START:int = 100;
        private const END:int = 400;
        private const TOTAL_TIME:int = 5;

        // ------- Private methods -------

        private function _createChildren():void
        {
            _rect = new Sprite();
            _rect.graphics.beginFill(0xff0000, 1);
            _rect.graphics.drawRect(0, 0, 100, 100);
            _rect.graphics.endFill();
            _rect.x = START;
            addChild(_rect);
            _rect.addEventListener(MouseEvent.CLICK, _rect_click);
        }

        // ------- Event handling -------

        private function _rect_click(event:MouseEvent):void
        {
            var tween:GTween = new GTween(_rect, TOTAL_TIME);
            tween.setValue("x", END);
//            tween.setValue("alpha", .5);
//            tween.ease = Sine.easeInOut;
//            tween.ease = Bounce.easeOut;
        }
    }
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://probertson.com/articles/2010/07/20/simple-actionscript-3-animation-examples/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>New project: AIR SQLite utilities</title>
		<link>http://probertson.com/articles/2010/02/03/new-project-air-sqlite-utilities/</link>
		<comments>http://probertson.com/articles/2010/02/03/new-project-air-sqlite-utilities/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 20:44:55 +0000</pubDate>
		<dc:creator>Paul Robertson</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Application Design]]></category>
		<category><![CDATA[Articles by Paul]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[local SQL database]]></category>

		<guid isPermaLink="false">http://probertson.com/?p=367</guid>
		<description><![CDATA[I&#8217;m excited to announce that I&#8217;m &#8220;officially&#8221; releasing a new open-source project that I&#8217;ve been using on personal and work projects for over a year.
For lack of a better name, I call it my &#8220;AIR SQLite utility library&#8221;
The code currently contains one major piece of functionality (well, two different variations on one bit of functionality), [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m excited to announce that I&#8217;m &#8220;officially&#8221; releasing a new open-source project that I&#8217;ve been using on personal and work projects for over a year.</p>
<p>For lack of a better name, I call it my &#8220;<a href="/projects/air-sqlite/">AIR SQLite utility library</a>&#8221;</p>
<p>The code currently contains one major piece of functionality (well, two different variations on one bit of functionality), which is a SQL &#8220;query runner&#8221; library. This is a wrapper for the AIR SQL classes that allows you to run a SQL statement by just passing a few bits of information:</p>
<ul>
<li>The text of the SQL statement itself</li>
<li>An object containing properties with the values for any statement parameters in the SQL</li>
<li>A Function to call when the operation completes</li>
<li>A failure Function</li>
<li>(optionally) a class to use as the data type for the data returned from a <code>SELECT</code> statement</li>
</ul>
<p>The library does all the work of creating SQLStatement objects and caching prepared queries, as well as pooling SQLConnection instances so you can execute multiple statements simultaneously. It also has a variation that allows you to specify a &#8220;batch&#8221; of statements to execute, and they are executed in order in a transaction.</p>
<p>I&#8217;ve also got an additional utility to add to the library. It&#8217;s a &#8220;database copy&#8221; utility that allows you to create a &#8220;deep copy&#8221; of a database &#8212; all it&#8217;s tables, views, etc. &#8212; with or without data. The key reason why this is useful is that you can use it to create an encrypted database from an unencrypted database (and vice-versa). It&#8217;s written and tested, but I decided to modify the structure slightly before releasing it, so it&#8217;s not checked in yet.</p>
<p>I&#8217;ve put the details about how it works and why it&#8217;s designed that way in <a href="/projects/air-sqlite/">the project page</a>. In case you&#8217;ve ever wondered how I design apps, I think the examples and this library give some insight into how I actually do my database-driven AIR app development. At least, how I structure the data-access part of my apps.</p>
<p>On (another) personal note, this project is also my first project that I&#8217;ve posted to <a href="http://github.com/probertson">my Github repository</a> (as opposed to projects I&#8217;ve forked). It was actually posted-but-not-advertised on Google code for a month or so, but I decided to move to Github because the collaboration and checkin-without-network-connection features are so awesome.</p>
]]></content:encoded>
			<wfw:commentRss>http://probertson.com/articles/2010/02/03/new-project-air-sqlite-utilities/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building iPhone apps with Flash Platform tools roundup</title>
		<link>http://probertson.com/articles/2009/10/05/building-iphone-apps-with-flash-platform-tools-roundup/</link>
		<comments>http://probertson.com/articles/2009/10/05/building-iphone-apps-with-flash-platform-tools-roundup/#comments</comments>
		<pubDate>Mon, 05 Oct 2009 21:35:36 +0000</pubDate>
		<dc:creator>Paul Robertson</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Articles to remember]]></category>
		<category><![CDATA[Elsewhere on the web]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://probertson.com/?p=340</guid>
		<description><![CDATA[Lots of news and rumors are flying around right now about developing iPhone apps using Flash Platform tools. Here&#8217;s a collection of links that I&#8217;ve found, some the official information and some information from folks who were involved in developing this cool new technology:

First thing first: if you haven&#8217;t seen the MythHackers video about Flash [...]]]></description>
			<content:encoded><![CDATA[<p>Lots of news and rumors are flying around right now about developing iPhone apps using Flash Platform tools. Here&#8217;s a collection of links that I&#8217;ve found, some the official information and some information from folks who were involved in developing this cool new technology:</p>
<ul>
<li>First thing first: if you haven&#8217;t seen the <a href="http://www.youtube.com/watch?v=lzqd5mHWTHE">MythHackers video about Flash on the iPhone</a>, you must go watch it. I laughed so hard my eyes were watering.</li>
<li>Aditya Bansod&#8217;s ADC article &#8220;<a href="http://www.adobe.com/devnet/logged_in/abansod_iphone.html">Developing for the Apple iPhone using Flash</a>,&#8221; from the Product Manager who&#8217;s in charge of the Flash Platform development for iPhone effort. Includes some technicial details on how it actually works and how you build the apps.</li>
<li><a href="http://labs.adobe.com/technologies/flashcs5/appsfor_iphone/">Adobe Labs: Apps for iPhone</a>: Video demo and list of apps that are already in the app store today</li>
<li><a href="http://labs.adobe.com/wiki/index.php/Applications_for_iPhone">Adobe Labs developer FAQ</a>: this has the most information about what this really means for developers</li>
<li>Mike Chambers is, as always, a great resource for information on this topic. He has <a href="http://www.mikechambers.com/blog/2009/10/05/building-applications-for-the-iphone-with-flash/">a nice summary blog post</a>, plus I know he&#8217;s collecting questions to answer in his MAX session (on Wednesday, I believe).</li>
<li>Arno Gourdol, engineering manager for Adobe AIR (and huge iPhone fan and former Apple employee) talks briefly about <a href="http://arno.org/arnotify/2009/10/max-2009-adobe-air-2-0-and-iphone-support/">the underlying technology, with a focus on MAX sessions where you can learn more</a>.</li>
<li>Never one to hold back his enthusiasm, Ted Patrick has posted <a href="http://onflash.org/ted/2009/10/source-to-4-flash-iphone-apps.php">the source code for three different Flash Platform iPhone apps he wrote</a>, that can be seen on the demo phones in the Adobe booth at MAX. (He says it&#8217;s four apps in the blog title, but he explains that two of them are the same app with and without hardware acceleration.)</li>
</ul>
<p>That&#8217;s all for now. I&#8217;ll keep updating the list as I find more resources.</p>
]]></content:encoded>
			<wfw:commentRss>http://probertson.com/articles/2009/10/05/building-iphone-apps-with-flash-platform-tools-roundup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thoughts from 360&#124;Flex day one</title>
		<link>http://probertson.com/articles/2009/05/18/thoughts-from-360flex-day-one/</link>
		<comments>http://probertson.com/articles/2009/05/18/thoughts-from-360flex-day-one/#comments</comments>
		<pubDate>Tue, 19 May 2009 03:49:21 +0000</pubDate>
		<dc:creator>Paul Robertson</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Elsewhere on the web]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[Sites to remember]]></category>
		<category><![CDATA[Unit testing]]></category>

		<guid isPermaLink="false">http://probertson.com/?p=276</guid>
		<description><![CDATA[Here are a few things that stood out to me the most in this great day at the greatest Flex conference on the planet:

FlexUnit 4. Wow. Big update. Very nice new features. Time to get (back) into it. (presentation by Michael Labriola)
Renaun Erickson&#8217;s Structured Log Testing framework. Another great, unexpected surprise. I didn&#8217;t really have [...]]]></description>
			<content:encoded><![CDATA[<p>Here are a few things that stood out to me the most in this great day at <a href="http://360flex.com/">the greatest Flex conference on the planet</a>:</p>
<ul>
<li><a href="http://opensource.adobe.com/wiki/display/flexunit/FlexUnit">FlexUnit 4</a>. Wow. Big update. Very nice new features. Time to get (back) into it. (presentation by <a href="http://blogs.digitalprimates.net/codeslinger/">Michael Labriola</a>)</li>
<li><a href="http://renaun.com/blog/">Renaun Erickson</a>&#8217;s <a href="http://structuredlogs.com/">Structured Log Testing framework</a>. Another great, unexpected surprise. I didn&#8217;t really have plans to go to this session except that Renaun&#8217;s such a smart, friendly guy. And frankly, I&#8217;ve never really had enough interest to take a look at his work on this project so far. Boy am I glad I changed my mind. This is definitely a testing approach I can get into &#8212; much less overhead than other approaches I&#8217;ve seen. Getting going with it is only barely more work than adding <code>trace()</code> calls. And the result is certainly infinitely more valuable.</li>
</ul>
<p>Considering I didn&#8217;t come to Indianapolis with any real interest in hearing more about testing&#8230;I&#8217;m surprised to find myself so excited by what I saw today. Today is a great day for Flex testing, that&#8217;s for sure.</p>
<p>I also got to hear some interesting ideas and future plans from <a href="http://jacwright.com/">Jacob Wright</a> and <a href="http://www.xtyler.com/">Tyler Wright</a>. (They made me a bit jealous &#8212; I wish I had a Flex programmer brother that I could see at conferences.) If you&#8217;re in Indianapolis, I recommend checking out their &#8220;write-in&#8221; session on the <a href="http://www.flightxd.com/flightframework/">Flight Framework</a> at 10am Tuesday in the Illinois East room.</p>
<p>Other less code-centric, but interesting, tidbits:</p>
<ul>
<li><a href="http://joeberkovitz.com/">Joe Berkovitz</a> is an avid mountain biker.</li>
<li><a href="http://blog.benstucki.net/">Ben Stucki</a> has a sweet five-year-old daughter who likes deep-fried calamari and pasta, although she wasn&#8217;t able to finish her macaroni and cheese at <a href="http://www.bucadibeppo.com/">Buca di Beppo</a>, where apparently even the child meals are sized to feed 3-4 people.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://probertson.com/articles/2009/05/18/thoughts-from-360flex-day-one/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Please test: updated ActionScript GZIP library with Flash Player 10 support</title>
		<link>http://probertson.com/articles/2009/02/27/actionscript-gzip-library-flash-player-10/</link>
		<comments>http://probertson.com/articles/2009/02/27/actionscript-gzip-library-flash-player-10/#comments</comments>
		<pubDate>Fri, 27 Feb 2009 22:40:50 +0000</pubDate>
		<dc:creator>Paul Robertson</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Articles by Paul]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://probertson.com/?p=232</guid>
		<description><![CDATA[Since I first created my ActionScript GZIP library as a test of Adobe AIR&#8217;s file compression capability, the number one request I&#8217;ve received has been to add support for Flash Player-only projects. With the release of Flash Player 10 last fall, I couldn&#8217;t use the lack of player support as an excuse any more. So [...]]]></description>
			<content:encoded><![CDATA[<p>Since I first created my <a href="/projects/gzipencoder/">ActionScript GZIP library</a> as a test of Adobe AIR&#8217;s file compression capability, the number one request I&#8217;ve received has been to add support for Flash Player-only projects. With the release of Flash Player 10 last fall, I couldn&#8217;t use the lack of player support as an excuse any more. So now I&#8217;ve just been using the &#8220;not enough time&#8221; excuse&#8230;</p>
<p>But not any more. A few days ago I checked in a beta (barely tested) version of that adds support for Flash Player 10 (browser) projects. It&#8217;s not linked from the main google code project page yet, but you can get to it from the <a href="http://code.google.com/p/ascompress/downloads/list">GZIP encoder project downloads page</a>.</p>
<p>The download that adds Flash Player 10 support is &#8220;ascompress-.2.0.zip&#8221;. It now includes two SWC files:</p>
<ul>
<li>GZIPEncoder_AIR.swc is the full package, with all the same features as the previous release (.1.0.2).</li>
<li>
<p>GZIPEncoder_Flash.swc is the Flash-Player-only version. It only compresses/uncompresses ByteArrays, and doesn&#8217;t have any support for files.</p>
<p>Of course, since Flash Player 10 also adds local file opening/saving support that uses ByteArray data for the files, you could easily write your own code to prompt the user for a gzip file, or compress a file and prompt the user to save it. For an example of opening and saving files from Flash Player 10, see my quick start article: &#8220;&#8221;</p>
</li>
</ul>
<p>As I implied when I described this as &#8220;beta (barely tested)&#8221; I haven&#8217;t done a lot of testing of this code yet. I don&#8217;t actually anticipate that there will be issues &#8212; really all I did was refactor the code into two classes instead of one &#8212; but that doesn&#8217;t mean there won&#8217;t be any issues, of course. =) If you&#8217;re interested, and especially if you&#8217;re one of the people who&#8217;s asked for this support, I would love it if you try it out and let me know how it works for you. If you&#8217;re willing to test it out, I&#8217;ll be happy to quickly make any fixes necessary.</p>
]]></content:encoded>
			<wfw:commentRss>http://probertson.com/articles/2009/02/27/actionscript-gzip-library-flash-player-10/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Flash Player 10 documentation available on labs</title>
		<link>http://probertson.com/articles/2008/05/21/flash-player-10-documentation-available-on-labs/</link>
		<comments>http://probertson.com/articles/2008/05/21/flash-player-10-documentation-available-on-labs/#comments</comments>
		<pubDate>Wed, 21 May 2008 18:08:05 +0000</pubDate>
		<dc:creator>Paul Robertson</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Articles to remember]]></category>
		<category><![CDATA[Elsewhere on the web]]></category>
		<category><![CDATA[Writing]]></category>

		<guid isPermaLink="false">http://probertson.com/?p=173</guid>
		<description><![CDATA[Lee Brimelow has just pointed out that the Flash Player 10 documentation is available for download on Adobe Labs. I&#8217;m excited that this is public, so I can start talking about it more &#8212; I&#8217;ve been working on the documentation for several months now =)
On a personal note, the screenshot that Lee posted for the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://theflashblog.com/">Lee Brimelow</a> has just pointed out that the Flash Player 10 documentation is <a href="http://download.macromedia.com/pub/labs/flashplayer10/flashplayer10_as3langref_052008.zip">available for download</a> on Adobe Labs. I&#8217;m excited that this is public, so I can start talking about it more &#8212; I&#8217;ve been working on the documentation for several months now =)</p>
<p>On a personal note, the <a href="http://theflashblog.com/?p=387">screenshot that Lee posted for the Vector class documentation</a> was written by me. So that was fun to see =)</p>
]]></content:encoded>
			<wfw:commentRss>http://probertson.com/articles/2008/05/21/flash-player-10-documentation-available-on-labs/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>New ActionScript unit testing framework</title>
		<link>http://probertson.com/articles/2008/05/01/new-actionscript-unit-testing-framework/</link>
		<comments>http://probertson.com/articles/2008/05/01/new-actionscript-unit-testing-framework/#comments</comments>
		<pubDate>Fri, 02 May 2008 03:58:09 +0000</pubDate>
		<dc:creator>Paul Robertson</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Elsewhere on the web]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[Sites to remember]]></category>
		<category><![CDATA[Unit testing]]></category>

		<guid isPermaLink="false">http://probertson.com/?p=172</guid>
		<description><![CDATA[Back in November 2005 (yes, 2.5 years ago!) I wrote an article about how data types and type checking work in ActionScript. ActionScript is different than many languages, in that the ActionScript compiler can be used for compile-time type checking (or not), and at runtime it is a strongly typed language, but it also has [...]]]></description>
			<content:encoded><![CDATA[<p>Back in November 2005 (yes, 2.5 years ago!) I wrote <a href="/articles/2005/11/08/actionscript-3-unit-testing-recommended/">an article about how data types and type checking work in ActionScript</a>. ActionScript is different than many languages, in that the ActionScript compiler can be used for compile-time type checking (or not), and at runtime it is a strongly typed language, but it also has features of dynamically typed languages. This allows for some flexibility but also means that you have to be careful about testing your code (because the compiler won&#8217;t always catch everything).</p>
<p>My conclusion (not original by any means) was that unit testing is an important tool for ActionScript developers. I&#8217;ve tried a couple of ActionScript unit testing frameworks (<a href="http://www.asunit.org/">ASUnit</a> and <a href="http://code.google.com/p/as3flexunitlib/">FlexUnit</a>). And finally getting to the point of this post, I was interested to learn today that the crew at <a href="http://www.digitalprimates.net/">Digital Primates</a> is releasing <a href="http://code.google.com/p/dpuint/">an open source unit testing framework for Flex, known as &#8220;dpunit&#8221;</a>.</p>
<p>(via <a href="http://jessewarden.com/">Jesse Warden</a> via <a href="http://twitter.com/jesterxl">Twitter</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://probertson.com/articles/2008/05/01/new-actionscript-unit-testing-framework/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Open Source Flex Visual Graph Library</title>
		<link>http://probertson.com/articles/2008/04/02/open-source-flex-visual-graph-library/</link>
		<comments>http://probertson.com/articles/2008/04/02/open-source-flex-visual-graph-library/#comments</comments>
		<pubDate>Wed, 02 Apr 2008 17:25:40 +0000</pubDate>
		<dc:creator>Paul Robertson</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Elsewhere on the web]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Sites to remember]]></category>

		<guid isPermaLink="false">http://probertson.com/articles/2008/04/02/open-source-flex-visual-graph-library/</guid>
		<description><![CDATA[A couple of months ago at a SilvaFUG meeting I saw a demo of some graph visualization libraries &#8212; the kind of thing you use to create a graph showing nodes linked together according to various relationships.
The current &#8220;favorite&#8221; is the Flex Visual Graph Library (FVGL) Open Source Project.
Their Visual Graph explorer sample gives a [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of months ago at a <a href="http://silvafug.org/">SilvaFUG</a> meeting I saw a demo of some graph visualization libraries &#8212; the kind of thing you use to create a graph showing nodes linked together according to various relationships.</p>
<p>The current &#8220;favorite&#8221; is the <a href="http://code.google.com/p/flexvizgraphlib/">Flex Visual Graph Library (FVGL) Open Source Project</a>.</p>
<p>Their <a href="http://flexvizgraphlib.googlecode.com/svn/trunk/vgExplorer/bin/VGExplorer.html">Visual Graph explorer sample</a> gives a nice overview of the functionality that&#8217;s available.</p>
<p>Anyway, I forgot to note this earlier, so I&#8217;m adding it now, though there&#8217;s a good chance this isn&#8217;t news to anyone who&#8217;s interested in this sort of thing.</p>
<p>(via email from <a href="http://www.onflex.org/ted/">Ted Patrick</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://probertson.com/articles/2008/04/02/open-source-flex-visual-graph-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Strongly typed arrays &#8212; coming to ActionScript near you</title>
		<link>http://probertson.com/articles/2008/03/28/vector-as3-strongly-typed-arrays-redux/</link>
		<comments>http://probertson.com/articles/2008/03/28/vector-as3-strongly-typed-arrays-redux/#comments</comments>
		<pubDate>Fri, 28 Mar 2008 21:35:52 +0000</pubDate>
		<dc:creator>Paul Robertson</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Articles by Paul]]></category>
		<category><![CDATA[Opinions]]></category>

		<guid isPermaLink="false">http://probertson.com/articles/2008/03/28/vector-as3-strongly-typed-arrays-redux/</guid>
		<description><![CDATA[I&#8217;ve been wanting to have strongly typed arrays in ActionScript for a long time. I was pretty excited when I read that it&#8217;s part of the EcmaScript 4th edition specification (in the form of the Vector class), and much more excited when I heard that the Vector class is being included in Flash Player &#8220;Astro&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been wanting to have strongly typed arrays in ActionScript <a href="/articles/2005/03/17/strongly-typed-arrays/">for a long time</a>. I was pretty excited when I read that it&#8217;s part of the <a href="http://wiki.ecmascript.org/">EcmaScript 4th edition</a> specification (in the form of <a href="http://wiki.ecmascript.org/doku.php?id=proposals:vector">the Vector class</a>), and <em>much</em> more excited when I heard that the Vector class is being included in Flash Player &#8220;Astro&#8221; (as <a href="http://www.zeuslabs.us/2008/02/25/live-from-360flex-day-one/">announced</a> <a href="http://ech.net/blog/2008/02/26/360flex-atlanta-day-one-impressions/">at 360 Flex Atlanta</a> by Matt Chotin).</p>
<p>Since the majority of the time when someone&#8217;s using an Array in ActionScript, they really want all the elements to be the same type anyway, this is a really great addition and I think it will be used heavily. The Vector class allows (requires) you to specify the type it will contain at compile time &#8212; both for variable declarations and when creating instances. In both cases the syntax you use is a &#8220;type parameter&#8221; suffix <code>.&lt;T&gt;</code>:</p>
<pre><code>var names:Vector.&lt;String&gt; = new Vector.&lt;String&gt;();</code></pre>
<p>The type parameter syntax is part of a separate EcmaScript 4th edition proposal. Sadly they couldn&#8217;t make the syntax identical to that for generics in C# (and I believe Java does it the same way), which is almost the same but without the initial <code>.</code> (period). (For an interesting read, take a look at <a href="http://wiki.ecmascript.org/doku.php?id=discussion:type_parameters#the_bracket_issue">the history of the various options the committee members considered for representing type parameters</a>.)</p>
<p>Anyway, because you specify the type at compile time, the idea is that the compiler can do the type checking for you for adding and getting elements from a Vector instance. In addition, since using Array (and the runtime type checking and type casting that array access involves) has always been a bottleneck in ActionScript performance, I expect that performance improvements can be expected. (Okay, I&#8217;ve heard anecdotal reports around the office of <em>much</em> better performance for Vector than for Array.)</p>
<p><a href="http://blogs.adobe.com/fcheng/">Francis Cheng</a> (who&#8217;s on the EcmaScript committee) has a couple of nice articles about the  <a href="http://blogs.adobe.com/fcheng/2008/02/vectors.html">Vector class</a> and <a href="http://blogs.adobe.com/fcheng/2008/02/type_parameters_in_ecmascript.html">type parameters</a>, so I won&#8217;t bother recreating everything he&#8217;s written. Definitely worth a read (like everything he writes).</p>
<p>As an (almost) final note, I should point out that I haven&#8217;t seen anything indicating that type parameters will be generally available in &#8220;Astro&#8221; &#8212; just Matt&#8217;s announcement about the Vector class specifically.</p>
<p>And finally, on a personal note, I&#8217;m excited because I get to do the documentation for the Vector class. It&#8217;s always fun getting to write about new features that are personally valuable. And this is one that I&#8217;ve definitely been interested in for a while!</p>
]]></content:encoded>
			<wfw:commentRss>http://probertson.com/articles/2008/03/28/vector-as3-strongly-typed-arrays-redux/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>New blog on ActionScript internals and future</title>
		<link>http://probertson.com/articles/2008/02/12/new-blog-on-actionscript-internals-and-future/</link>
		<comments>http://probertson.com/articles/2008/02/12/new-blog-on-actionscript-internals-and-future/#comments</comments>
		<pubDate>Tue, 12 Feb 2008 19:30:02 +0000</pubDate>
		<dc:creator>Paul Robertson</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Elsewhere on the web]]></category>
		<category><![CDATA[Sites to remember]]></category>

		<guid isPermaLink="false">http://probertson.com/articles/2008/02/12/new-blog-on-actionscript-internals-and-future/</guid>
		<description><![CDATA[A co-worker and friend of mine, Francis Cheng, recently started a new blog that I wanted to share:
http://blogs.adobe.com/fcheng/
Francis is a former engineer on the Flash Authoring team (and before that, a lawyer). He&#8217;s been in his current position on the ActionScript documentation team for several years. He&#8217;s also one of Adobe&#8217;s representatives on the ECMAScript [...]]]></description>
			<content:encoded><![CDATA[<p>A co-worker and friend of mine, Francis Cheng, recently started a new blog that I wanted to share:</p>
<p><a href="http://blogs.adobe.com/fcheng/">http://blogs.adobe.com/fcheng/</a></p>
<p>Francis is a former engineer on the Flash Authoring team (and before that, a lawyer). He&#8217;s been in his current position on the ActionScript documentation team for several years. He&#8217;s also one of Adobe&#8217;s representatives on the ECMAScript language committee, so he&#8217;s got a better idea than anyone else I know of the internals and future of the core ActionScript language.</p>
<p>So far his posts have been really great if, like me, you&#8217;re interested in knowing more about the less-used features of ActionScript and also getting an early look at new features that will probably be in future versions of ActionScript.</p>
]]></content:encoded>
			<wfw:commentRss>http://probertson.com/articles/2008/02/12/new-blog-on-actionscript-internals-and-future/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating more secure SWF applications</title>
		<link>http://probertson.com/articles/2008/01/03/creating-more-secure-swf-applications/</link>
		<comments>http://probertson.com/articles/2008/01/03/creating-more-secure-swf-applications/#comments</comments>
		<pubDate>Thu, 03 Jan 2008 23:02:45 +0000</pubDate>
		<dc:creator>Paul Robertson</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Application Design]]></category>
		<category><![CDATA[Articles to remember]]></category>
		<category><![CDATA[Elsewhere on the web]]></category>

		<guid isPermaLink="false">http://probertson.com/articles/2008/01/03/creating-more-secure-swf-applications/</guid>
		<description><![CDATA[If you&#8217;re like me and you&#8217;ve been heads-down in work or just getting through the pre/post-Christmas season, you may have missed the article &#8220;Creating more secure SWF web applications&#8221; by Peleus Uhley, that was posted on the Adobe Developer Center on Dec. 20.
In spite of the bad timing, it&#8217;s a nice, thorough article that gives [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re like me and you&#8217;ve been heads-down in work or just getting through the pre/post-Christmas season, you may have missed the article &#8220;<a href="http://www.adobe.com/devnet/flashplayer/articles/secure_swf_apps.html">Creating more secure SWF web applications</a>&#8221; by Peleus Uhley, that was posted on the Adobe Developer Center on Dec. 20.</p>
<p>In spite of the bad timing, it&#8217;s a nice, thorough article that gives a good view of things that we can do to make our apps more secure, in addition to security updates that Adobe continues to make to Flash Player.</p>
<p>(via email from Jeff Swartz)</p>
]]></content:encoded>
			<wfw:commentRss>http://probertson.com/articles/2008/01/03/creating-more-secure-swf-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Adobe Dev Center articles (Flash deep-linking and Flash CS3 DataGrid)</title>
		<link>http://probertson.com/articles/2007/11/13/two-developer-center-articles/</link>
		<comments>http://probertson.com/articles/2007/11/13/two-developer-center-articles/#comments</comments>
		<pubDate>Tue, 13 Nov 2007 18:14:06 +0000</pubDate>
		<dc:creator>Paul Robertson</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Articles by Paul]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Writing]]></category>

		<guid isPermaLink="false">http://probertson.com/articles/2007/11/13/two-developer-center-articles/</guid>
		<description><![CDATA[Several months ago I was asked to re-purpose two of my previous articles from this site for publication on the Adobe Developer Center (now renamed as the &#8220;Adobe Developer Connection&#8221;). The first one was published in September 2007, and the second was just published yesterday. So in a way this is sort of a revisiting [...]]]></description>
			<content:encoded><![CDATA[<p>Several months ago I was asked to re-purpose two of my previous articles from this site for publication on the Adobe Developer Center (now renamed as the &#8220;Adobe Developer Connection&#8221;). The first one was published in September 2007, and the second was just published yesterday. So in a way this is sort of a revisiting of previous topics, but if you missed them before here they are in their new-and-improved form (or if you&#8217;re just really curious about me, you can see what I look like in my author photo on the articles =):</p>
<ul>
<li><a href="http://www.adobe.com/devnet/flash/articles/deep_linking.html">Deep-linking to frames in Flash websites</a> (Sept. 10, 2007) - for this article I took just one of the techniques I described in <a href="/articles/2006/12/14/deep-linking-flash-application-states/">the original article</a> and added more background information and better explanations. (I&#8217;m sometimes amazed by how much detail I leave out when I&#8217;m writing posts on this site!)</li>
<li><a href="http://www.adobe.com/devnet/flash/articles/detecting_datagrid_edits.html">Detecting when data is edited in the DataGrid component</a> (Nov. 12, 2007) - this article was revised much less from <a href="/articles/2007/05/01/flash-cs3-datagrid-detecting-data-change/">the original</a> than the other one. Basically I took the text and found places where I thought it needed more/better/clearer explanation, and added a sentence or revised the text. I definitely think the new version is better, but there isn&#8217;t any new information to be had if you read the original.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://probertson.com/articles/2007/11/13/two-developer-center-articles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AIR embedded SQL database: What&#8217;s new in beta 2</title>
		<link>http://probertson.com/articles/2007/10/09/air-sql-database-what-s-new-in-beta-2/</link>
		<comments>http://probertson.com/articles/2007/10/09/air-sql-database-what-s-new-in-beta-2/#comments</comments>
		<pubDate>Tue, 09 Oct 2007 23:41:55 +0000</pubDate>
		<dc:creator>Paul Robertson</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Articles by Paul]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[local SQL database]]></category>

		<guid isPermaLink="false">http://probertson.com/articles/2007/10/09/air-sql-database-what-s-new-in-beta-2/</guid>
		<description><![CDATA[Now that the roar of MAX is over, and since AIR public beta 2 is now available on Adobe Labs, I thought I&#8217;d highlight what&#8217;s new in beta 2 specifically around the embedded SQL database in AIR:

Synchronous database operations
Schema API (database instrospection)
Additional data types
Other new documentation
Bug fixes

Synchronous database operations
From the various public and internal feedback [...]]]></description>
			<content:encoded><![CDATA[<p>Now that the roar of MAX is over, and since <a href="http://labs.adobe.com/technologies/air/">AIR public beta 2</a> is now available on Adobe Labs, I thought I&#8217;d highlight what&#8217;s new in beta 2 specifically around the embedded SQL database in AIR:</p>
<ul>
<li><a href="#sync">Synchronous database operations</a></li>
<li><a href="#schema">Schema API (database instrospection)</a></li>
<li><a href="#types">Additional data types</a></li>
<li><a href="#docs">Other new documentation</a></li>
<li><a href="#bugs">Bug fixes</a></li>
</ul>
<h2 id="sync">Synchronous database operations</h2>
<p>From the various public and internal feedback forums I&#8217;ve seen (discussion lists, mailing lists, etc.) this is definitely the most-requested feature from beta 1 (at least related to the embedded database). It&#8217;s in there now &#8212; when you instantiate a SQLConnection object, just add <code>true</code> as a constructor argument and all the operations (including SQL statements) that are executed through that SQLConnection will run synchronously.</p>
<p>The good news is it&#8217;s really very similar to the way things worked in beta 1, so if you&#8217;ve already been doing things asynchronously you won&#8217;t have to do much to get going with synchronous db operations. Note that a lot of people have referred to this as a &#8220;synchronous API&#8221; but in fact there isn&#8217;t a separate synchronous API &#8212; it&#8217;s the same API, with the exception of the single <code>SQLConnection()</code> argument.</p>
<p>To learn more, here&#8217;s the place where you should probably start: Developing AIR Applications > Working with files and data > Working with local SQL databases > Using synchronous and asynchronous database operations (<a href="http://livedocs.adobe.com/labs/air/1/devappsflex/SQL_23.html#1096192">Flex</a> | <a href="http://livedocs.adobe.com/labs/air/1/devappshtml/SQL_23.html#1096192">HTML/JavaScript</a> | <a href="http://livedocs.adobe.com/labs/air/1/devappsflash/SQL_23.html#1096192">Flash</a>)</p>
<h2 id="schema">Schema API (database instrospection)</h2>
<p>One limitation that developers pointed out in beta 1 was that there wasn&#8217;t any built-in way to get information about the structure of a database, tables, etc. In beta 2, there&#8217;s a new set of classes that can be used to get at that information. There isn&#8217;t any information in the developers guide about this yet, but in this case you can figure it out by looking in the API reference. The best place to start is probably with the <code>SQLConnection.loadSchema()</code> method (<a href="http://livedocs.adobe.com/labs/flex3/langref/flash/data/SQLConnection.html#loadSchema()">Flex</a> | <a href="http://livedocs.adobe.com/labs/air/1/jslr/flash/data/SQLConnection.html#loadSchema()">HTML/JavaScript</a> | <a href="http://livedocs.adobe.com/labs/air/1/aslr/flash/data/SQLConnection.html#loadSchema()">Flash</a>).</p>
<p>There are also several new classes that are used for the various types of schema information you can get:</p>
<ul>
<li>SQLTableSchema (<a href="http://livedocs.adobe.com/labs/flex3/langref/flash/data/SQLTableSchema.html">Flex</a> | <a href="http://livedocs.adobe.com/labs/air/1/jslr/flash/data/SQLTableSchema.html">HTML/JavaScript</a> | <a href="http://livedocs.adobe.com/labs/air/1/aslr/flash/data/SQLTableSchema.html">Flash</a>)</li>
<li>SQLViewSchema (<a href="http://livedocs.adobe.com/labs/flex3/langref/flash/data/SQLViewSchema.html">Flex</a> | <a href="http://livedocs.adobe.com/labs/air/1/jslr/flash/data/SQLViewSchema.html">HTML/JavaScript</a> | <a href="http://livedocs.adobe.com/labs/air/1/aslr/flash/data/SQLViewSchema.html">Flash</a>)</li>
<li>SQLIndexSchema (<a href="http://livedocs.adobe.com/labs/flex3/langref/flash/data/SQLIndexSchema.html">Flex</a> | <a href="http://livedocs.adobe.com/labs/air/1/jslr/flash/data/SQLIndexSchema.html">HTML/JavaScript</a> | <a href="http://livedocs.adobe.com/labs/air/1/aslr/flash/data/SQLIndexSchema.html">Flash</a>)</li>
<li>SQLTriggerSchema (<a href="http://livedocs.adobe.com/labs/flex3/langref/flash/data/SQLTriggerSchema.html">Flex</a> | <a href="http://livedocs.adobe.com/labs/air/1/jslr/flash/data/SQLTriggerSchema.html">HTML/JavaScript</a> | <a href="http://livedocs.adobe.com/labs/air/1/aslr/flash/data/SQLTriggerSchema.html">Flash</a>)</li>
<li>SQLColumnSchema (<a href="http://livedocs.adobe.com/labs/flex3/langref/flash/data/SQLColumnSchema.html">Flex</a> | <a href="http://livedocs.adobe.com/labs/air/1/jslr/flash/data/SQLColumnSchema.html">HTML/JavaScript</a> | <a href="http://livedocs.adobe.com/labs/air/1/aslr/flash/data/SQLColumnSchema.html">Flash</a>)</li>
</ul>
<h2 id="types">Additional data types</h2>
<p>Several ActionScript/JavaScript data types can now be used as column data types in the <code>CREATE TABLE</code> statements. When you specify one of these data types for your column, you can pass an instance of that type into an SQL statement (using a parameter) and it will property store and retrieve the data as the ActionScript/JavaScript data type. The new supported data types are:</p>
<ul>
<li>Boolean</li>
<li>Date</li>
<li>XML</li>
</ul>
<p>More information about these data types can be found in the developers guide section &#8220;Working with database data types&#8221; (<a href="http://livedocs.adobe.com/labs/air/1/devappsflex/SQL_19.html#1095961">Flex</a> | <a href="http://livedocs.adobe.com/labs/air/1/devappshtml/SQL_19.html#1095961">HTML/JavaScript</a> | <a href="http://livedocs.adobe.com/labs/air/1/devappsflash/SQL_19.html#1095961">Flash</a>) and in the language reference appendix &#8220;SQL support in local databases&#8221; (specifically the &#8220;<a href="http://livedocs.adobe.com/labs/flex3/langref/localDatabaseSQLSupport.html#dataTypes">data type support</a>&#8221; section). (Note that the link goes to the Flex language reference. I couldn&#8217;t find that appendix in the Flash or HTML/JS versions, although the content is identical for all of them since it&#8217;s really just talking about SQL.)</p>
<h2 id="docs">Other new documentation</h2>
<p>Although I did take several weeks between beta 1 and beta 2 to move from Indiana to the San Francisco bay area, I did get some additional documentation written. If I remember right, these are the sections that are new for beta 2 (other than the ones I&#8217;ve already mentioned above):</p>
<ul>
<li>Using parameters in statements (<a href="http://livedocs.adobe.com/labs/air/1/devappsflex/SQL_10.html">Flex</a> | <a href="http://livedocs.adobe.com/labs/air/1/devappshtml/SQL_10.html">HTML/JavaScript</a> | <a href="http://livedocs.adobe.com/labs/air/1/devappsflash/SQL_10.html">Flash</a>)</li>
<li>Strategies for working with SQL databases (<a href="http://livedocs.adobe.com/labs/air/1/devappsflex/SQL_26.html#1084956">Flex</a> | <a href="http://livedocs.adobe.com/labs/air/1/devappshtml/SQL_26.html#1084956">HTML/JavaScript</a> | <a href="http://livedocs.adobe.com/labs/air/1/devappsflash/SQL_26.html#1084956">Flash</a>) - new sections on improving performance and best practices</li>
<li>&#8230; and more! (improvements and corrections in various other sections)</li>
</ul>
<h2 id="bugs">Bug fixes</h2>
<p>Need I say more? =)</p>
<p>(In seriousness, lots of bugs were fixed, so if there&#8217;s an issue you were running into, try it out in beta 2 and <a href="http://www.adobe.com/go/wish/">let us know</a> if it&#8217;s still not working.)</p>
]]></content:encoded>
			<wfw:commentRss>http://probertson.com/articles/2007/10/09/air-sql-database-what-s-new-in-beta-2/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Learn ActionScript from Colin Moock for free!</title>
		<link>http://probertson.com/articles/2007/09/11/learn-actionscript-from-colin-moock-for-free/</link>
		<comments>http://probertson.com/articles/2007/09/11/learn-actionscript-from-colin-moock-for-free/#comments</comments>
		<pubDate>Tue, 11 Sep 2007 17:29:51 +0000</pubDate>
		<dc:creator>Paul Robertson</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Elsewhere on the web]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://probertson.com/articles/2007/09/11/learn-actionscript-from-colin-moock-for-free/</guid>
		<description><![CDATA[Tours are starting to be all the rage with Adobe (and others). With the launch of CS3 Adobe did a conference tour, and of course there&#8217;s the onAIR bus tour that&#8217;s making it&#8217;s way around the country promoting AIR.
Now, if you or someone you know is a Flash designer with almost-none-to-basic ActionScript experience, and you [...]]]></description>
			<content:encoded><![CDATA[<p>Tours are starting to be all the rage with Adobe (and others). With the launch of CS3 Adobe did a conference tour, and of course there&#8217;s the <a href="http://onair.adobe.com/">onAIR bus tour</a> that&#8217;s making it&#8217;s way around the country promoting <a href="http://www.adobe.com/go/air/">AIR</a>.</p>
<p>Now, if you or someone you know is a Flash designer with almost-none-to-basic ActionScript experience, and you want to learn ActionScript from <a href="http://moock.org/">the established master</a>, you can do it for free. Adobe is sponsoring a <a href="http://www.adobeas3tour.com/">free, one-day ActionScript training course given by Colin Moock</a> that&#8217;s traveling around the U.S. (and eventually the world) starting in October 2007.</p>
<p>They&#8217;re calling it &#8220;<a href="http://www.adobeas3tour.com/">Colin Moock&#8217;s ActionScript 3.0: From the Ground Up Tour</a>.&#8221; And you shouldn&#8217;t feel intimidated if you are just getting started with ActionScript &#8212; the site explicitly says it&#8217;s not for advanced developers, so if you&#8217;re just getting going (i.e. you&#8217;ve done some frame scripts but not anything with classes) you should be in your element.</p>
<p>Currently it looks like there are stops scheduled in San Francisco, Los Angeles, and New York City. Even if you don&#8217;t live in one of those areas, think of it this way &#8212; for only the price of travel you&#8217;re getting an awesome training experience.</p>
<p>(via <a href="http://www.stefanmedia.com/">Stefan Gruenwedel</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://probertson.com/articles/2007/09/11/learn-actionscript-from-colin-moock-for-free/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AIR, local SQL databases, and my role</title>
		<link>http://probertson.com/articles/2007/06/11/adobe-air-local-sql-databases-and-my-role/</link>
		<comments>http://probertson.com/articles/2007/06/11/adobe-air-local-sql-databases-and-my-role/#comments</comments>
		<pubDate>Mon, 11 Jun 2007 21:37:56 +0000</pubDate>
		<dc:creator>Paul Robertson</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Articles by Paul]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Writing]]></category>
		<category><![CDATA[local SQL database]]></category>

		<guid isPermaLink="false">http://probertson.com/articles/2007/06/11/adobe-air-local-sql-databases-and-my-role/</guid>
		<description><![CDATA[As everyone knows, today Adobe released a public beta of AIR (formerly "Apollo"). As you likely know, since it was announced last week, one of the big new features in this release is an integrated database engine that allows AIR applications to create and use local SQL databases. I'm really excited about this, both because it's really awesome to be able to access a database directly from ActionScript, and (on a personal level) because it means I can finally talk about what I've been working on for the last couple of months. Yes, in fact, my latest assignment at Adobe primarily involves working on the AIR local SQL database functionality.]]></description>
			<content:encoded><![CDATA[<p>As everyone knows, today Adobe released a public beta of AIR (formerly &#8220;Apollo&#8221;). As you likely know, since it was announced last week, one of the big new features in this release is an integrated database engine that allows AIR applications to create and use local SQL databases.</p>
<p>Okay, that sounds really boring. But I don&#8217;t mean it to. I&#8217;m actually <em>incredibly</em> excited by this, because it makes it a lot easier for people like me, with web app experience but not desktop app experience, to create data-driven apps and store persistent data using techniques that I&#8217;m familiar with.</p>
<p>And, on a personal note, it means that I finally get to talk about what I&#8217;ve been working on for the last couple of months. If you actually follow my web site, you&#8217;ve probably picked up on the fact that I was heavily involved in the ActionScript-related documentation for the Flash CS3 release. Well, naturally, now that Flash CS3 is out the door, I&#8217;ve been moved onto another project &#8212; onto Apollo/AIR, specifically.</p>
<p>More specifically, since I&#8217;ve been programming SQL databases for many years, as part of my web app development work, I got pegged (well, I actually volunteered) to do the documentation and samples for the local SQL databases feature.</p>
<p>When I first read the spec for the feature, I was completely floored. I was expecting some minimal support for a few things, but what we&#8217;ve got is much more than I could come up with use cases for. Want a good idea of the breadth of the functionality that&#8217;s available? Spend some time reading &#8220;<a href="http://livedocs.adobe.com/labs/flex/3/langref/localDatabaseSQLSupport.html">SQL support in local databases</a>&#8221; (it&#8217;s an appendix of the AIR language reference). Views? Indexes? Triggers? They&#8217;re in there.</p>
<p>In case you don&#8217;t have a free few hours, I&#8217;ll just point out my favorite parts of the feature. These will probably be most meaningful if you&#8217;ve already faced the joy and pain of working with web-database apps, especially with an OOP language:</p>
<ul>
<li><code><a href="http://livedocs.adobe.com/labs/flex/3/langref/flash/data/SQLStatement.html#itemClass">SQLStatement.itemClass</a></code>: This was my immediate favorite. You specify a class, and SELECT statement result rows are automatically converted into instances of that class (saving lots of boilerplate code to loop through results and turn rows into instances of some other class). If I could have done this in ASP.NET, I&#8217;d probably have saved about 25% of the total code I wrote.</li>
<li><code><a href="http://livedocs.adobe.com/labs/flex/3/langref/flash/data/SQLStatement.html#prepare()">SQLStatement.prepare()</a></code> and <code><a href="http://livedocs.adobe.com/labs/flex/3/langref/flash/data/SQLStatement.html#parameters">SQLStatement.parameters</a></code>: Now that I&#8217;ve spent some time building apps and working with the code, I&#8217;ve gotten a lot of respect for this method. Basically, this is the way to create the equivalent of pre-compiled stored procedures for your AIR app.</li>
<li><code><a href="http://livedocs.adobe.com/labs/flex/3/langref/flash/data/SQLResult.html#lastInsertRowID">SQLResult.lastInsertRowID</a></code>: I had to lobby long and hard for this one, which, since I&#8217;m a remote employee, meant <em>lots</em> of email exchanges. Finally I managed to clearly articulate my reason, and sure enough, persistence paid off. If you&#8217;ve created a database app, chances are you&#8217;ve run into the case where you INSERT a row, and you need to get back the auto-generated primary key so that you can insert a related row. The <em>wrong</em> way to do it is <code>SELECT MAX(id_column) FROM table</code>. The right way, in AIR, is to use <code>lastInsertRowID</code>.</li>
</ul>
<p>I&#8217;m excited that I can talk about this now. I&#8217;ve got some samples, practices, and information that I&#8217;m looking forward to sharing. I&#8217;ll start with an answer to a question that I&#8217;ve seen asked around (well, mostly I&#8217;ve just seen misinformation, not people asking whether it&#8217;s right) about the relationship between the AIR local SQL database API and the Google Gears SQL database API:</p>
<ul>
<li>Does Apollo &#8220;include&#8221; part of Google Gears? - No. There is no shared code between AIR and Google Gears (with the possible exception noted in the next answer).</li>
<li>What do AIR and Google Gears have in common, then? - Both AIR and Google Gears let you create applications that access databases located on a users local machine. Both AIR and Google Gears chose to use SQLite, a free, public domain embedded SQL database engine, to provide that functionality. So whatever code AIR uses that hasn&#8217;t been modified from SQLite, is the same as the code that Google Gears uses that hasn&#8217;t been modified in its implementation of SQLite.</li>
<li>What&#8217;s this about AIR including the same database API as Google Gears? - To be honest, although I&#8217;ve been involved in the AIR database API for a while, the first I heard of Google Gears&#8217; database API was when the public announcements were made. Thinking back, I see now that discussions were going on for a while, and I even unknowingly provided some support to the management team and others who were involved in that discussion. Right now, although the underlying database engines are based on the same engine, since SQLite is written in C, any implementation that doesn&#8217;t use C/C++ needs to write its own API. The two implementations (Adobe&#8217;s and Google&#8217;s) weren&#8217;t developed together, and at this point (from what I&#8217;ve seen) the two APIs are pretty different. Case in point: synchronous versus asynchronous database operations. In Google Gears, data access operations are synchronous &#8212; calls to the database are blocking, meaning the runtime freezes at the line of code that called the database until the result is returned. In AIR, on the other hand, all data operations are asynchronous &#8212; you call <code>SQLStatement.execute()</code> to run a query, and when the result comes back an event listener function is called (at which point the result data can be accessed). That alone means a big difference in how you write code to work with the two systems.</li>
<li>So wait a minute, what about the whole &#8220;Adobe and Google are working together on the database API&#8221; thing? - Adobe and Google <em>are</em> having &#8220;discussions,&#8221; and (from what I&#8217;ve heard) the plan is to hopefully make the APIs the same or similar enough that a developer who writes data access code for Google Gears will have an easy time writing data access code for AIR (and vice versa). In addition, since the SQL part of both runtimes really is dependent on SQLite much more than the particular runtime implementation, and SQL code probably is interchangeable between the two runtimes, assuming the same database schema etc.</li>
</ul>
<p>So from me, and the other engineers and stakeholders inside Adobe, please try out the local SQL database functionality of Apollo, and <strong>please</strong> let us know what we can do to make it better. In particular, let me know what is missing or what you&#8217;d like to see in terms of documentation and samples &#8212; but don&#8217;t limit yourself to that. <em>Please share your comments/suggestions!</em></p>
<h2 id="personal">On a more personal note&#8230;</h2>
<p>I&#8217;m really excited about this. I really just can&#8217;t say in words how excited I am. When I decided to accept an offer to work full-time for Adobe, one of the first &#8220;regrets&#8221; that crossed my mind was when I considered that it was highly likely that I wouldn&#8217;t be doing any more database programming (since my work involves dealing with ActionScript, and up to now there hasn&#8217;t really been any direct database access from ActionScript). So I was excited to say the least when I heard about this feature and it was decided that I&#8217;d get to work on it.</p>
<p>Suffice it to say, this has been a pretty busy time. This feature was actually slated to appear in a later release, but at the near-last minute the decision was made to get it done in time for the public beta. That meant a lot of writing and application-building in a hurry! Then two weeks and a private beta release later, a group of people including me, engineers and QEs, and other interested folks, went through a few rounds of discussions on what was missing and what we could do to make the API better. The result, which of course still isn&#8217;t finished, is what you can download today.</p>
<p>And, although she isn&#8217;t a developer and doesn&#8217;t use Apollo/AIR at all, it&#8217;s an understatement to say that my wife is glad to see this beta out the door, if only because it means I don&#8217;t have to work evenings any more (it&#8217;s been a <strong>very</strong> busy month+ =).</p>
]]></content:encoded>
			<wfw:commentRss>http://probertson.com/articles/2007/06/11/adobe-air-local-sql-databases-and-my-role/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
	</channel>
</rss>
