February 13th, 2007
One of the nicest things about Flash Remoting in Actionscript 2 is the pageable recordset functionality. This allows you to split the results of a large data set into chunks, or pages, that can be downloaded on an as-needed basis. This is a demonstration of how to use this paging functionality with XML-based web services. Specifically, I’ve created a sample application that uses the Flickr REST API (XML) to do a photo search.
Demo: Flickr Tag Search
Source: FlickrDemo.zip
Enter a tag in the search box, and hit ‘go’. The results are loaded in batches of 100, and they fill in as you scroll. As you can see, we know how many records are available even before they are all loaded. We are
I’ve used this feature on a number of projects that included Flash remoting, and it is truly amazing. When in paged loading mode, a recordset instance is like an array that doesn’t have all it’s slots filled in. If I am a movie clip representing a datagrid row that needs record at slot 537 and that record is not loaded yet, the recordset gives me a little message, “in progress”, instead of the actual data. The mx.remoting.Recordset class and it’s friends take care of managing the server requests needed to load the missing data. Then, I simply listen for model change events until I get the data I need. As the definition above states, the List-based v2 UI components all understand this data provider API and can auto-fill themselves on an as-needed basis. This makes it possible to create things like scrolling lists that have thousands of records.
There are times when I’ve needed this same kind of paged loading functionality, but I didn’t have access to Flash remoting. Instead, I needed to use an XML-based service that returned results based on GET method parameters that would either specify or range of records to return or simply a page number and the number of items per page. So, I have built a couple of classes that fetch data using XML and then use the built-in paging functionality provided with the mx.remoting code. This system has been set up in such a way that you can simply extend my XmlRecordsetService base class, implement a few key functions, and your result will be an instance of a class that extends mx.remoting.RecordSet. This recordset can be plugged in to any of the list-based components that come with Flash including the DataGrid that I have used in my demo.
Now, on to the code…
Read the rest of this entry »
Posted in Actionscript, Flash | No Comments »
January 30th, 2007
I’ve created a new package of my AS2 libraries over on SourceForge.
http://bumpslide.sourceforge.net/
The latest release has been labeled 0.9.4, as I have updated things to work with the latest version of the ASAP Framework. Numerous bug fixes are here as well as general day-to-day improvements across all the utilities.
Posted in News | No Comments »
January 18th, 2007

Demo: Interpolating Points on a Sine Curve
Source: interpolate_sine.zip
A recent post on the gotoAndPlay.net flashlist asked about charting the sine wave in flash using the drawing API. The problem with the drawing API is that the quadratic bezier curveTo functions don’t make for the smoothest curves without a little trickery.
Patrick Mineault has a great piece on his blog about piecewise cubic beziers. Using his code, we can interpolate between the points on a sine curve quite smoothly. I thought his demo was quite nice, so I download his source, hacked it a bit, and came up with this demo.
Yes, it makes a nice smooth curve, if that’s what you’re after, but the fun starts when you start playing with the controls. A good place to start is by setting the wavelength to 2 while increasing the overshoot. Once the wavelength gets below 4 pixels, the cubic bezier interpolation no longer has enough points to interpolate the high frequency wave accurately. Increasing the overshoot factor creates some unexpectedly fun curls. Altering the number of points plotted gives us even more variation.




Posted in Actionscript, Flash | 3 Comments »
December 19th, 2006
Ok, I told myself I wouldn’t use this forum as a place to post links, but this is good. regdeveloper.co.uk has an interview with Mark Anders of the Flex team. He talks a lot about his experiences with .NET, and it’s a quite revealing read.
Regarding tool development in Eclipse vs. .NET…
I’d spent the last six years working on building a managed code platform; I thought it was goofy to build in C++. The thing I concluded about .NET was if you’re trying to build code to run on a variety of platforms .NET offers you nothing - where’s the cross platform window forms?
Regarding changes to ActionScript…
When we moved to ActionScript 3, we had to port all this code and there were a number of places where the programmers said ‘How did we ever ship that? That code just doesn’t work’. Once you have real strong typing it ferrets out things you didn’t know were there, even if you’re a great developer.
Posted in Flash | No Comments »
November 24th, 2006
FTween is a simple tweening utility designed to fill a need not met by the Penner family of time-based tweening solutions. The problem case is one where a target is constantly moving and/or changing at unexpected times. The Penner equations rely on the assumption that a tween will last for a known length of time, but it is often the case that I simply want a smooth transition from one state to another. Tweening content for smooth scrolling and animating a tree menu are two common examples where time-based tweening can have stuttering or less than desirable result. When animating a sprite in such as way that it follows a moving target, Penner tweens don’t work at all.
Read the rest of this entry »
Posted in Actionscript | 2 Comments »
November 8th, 2006
MTASC, the open-source Actionscript compiler, has become an essential part of my daily routine. I used it for a long time with custom built BAT files that would inject compiled code into my library SWF’s, but now I can do all of this with FlashDevelop. There are other editors out there, but FlashDevelop is my current IDE of choice, and it just so happens that it has a cute little feature I’ve not seen elsewhere. That feature is called “Quick MTASC Build”, and I use it all the time to build quick test SWF’s without ever having to open up the Flash authoring environment. I refer to these FLA-less SWF’s as MTASC Applets.
Read the rest of this entry »
Posted in Actionscript | No Comments »
November 6th, 2006
I am now sharing an office space with my friend and former Second Story colleague, JD Hooge. After a month of work, we have finally moved into the little corner office at SE 6th and Alder here in Portland. We’re one of a handful of tenants occupying spaces above the Melody Ballroom where they have a strange combination of wedding receptions, office parties, and church services a couple times a week.
Since signing the lease, we ripped up all the carpet, refinished the floors (with the help of some guys with big sanders), and put in a few days worth of patching and painting the walls. We’re still acquiring necessities, but I’m officially working from an office again instead of that spare bedroom where my desk was 2 feet from the ironing board. I can proudly turn on the webcam again when Skype-ing.
Thanks to JD, pictures are on flickr.
Posted in News | No Comments »
October 30th, 2006
Much has been written about smoothing dynamically loaded bitmaps in Flash 8. But, just in case you missed it, here’s the short version: Flash 8 allows you to smooth dynamically loaded images such as JPG’s at runtime by taking a snapshot of the image using BitmapData and redrawing it on to a MovieClip with smoothing applied..
It’s one of those things you may never have realized you were missing until now.
Read the rest of this entry »
Posted in Actionscript | 7 Comments »
October 30th, 2006
Hi, my name is David Knape, and I’m starting yet another blog in order to share my thoughts on Flash development and related topics. I am a programmer, not an animator or timeline tweener, so you will see more code here than anything else.
Read the rest of this entry »
Posted in News | 2 Comments »