Archive for the 'News' Category

SWX Ruby updates to Alpha 0.1.1, has new screencast

Swx Ruby Silent Movie

Jed Hurt has updated SWX Ruby, the SWX RPC implementation in Ruby (currently for Ruby on Rails) to Alpha 0.1.1. He has also recorded a new screencast to show you how to get up and running with it.

Check out the SWX Ruby homepage and the SWX Ruby blog.

Zoom-In Online Interview

Todd Howard from Zoom In Online interviewed me after my talk at FlashForward Boston. We talked about Flash, SWX, and playing with APIs and open data.

Listen to the interview online.

Video: Thermo Sneak Peek at Adobe MAX Day 2 Keynote

Part I

Adobe's most exciting announcement at the Day 2 Keynote at MAX Chicago 2007 was Thermo.

Thermo is a new tool that lets designers create Rich Internet Applications in a very visual manner. You can convert artwork into working components in a single click.

What do I think? Thermo rocks!

Since the video is longer than 10 minutes, I've had to break it up into several parts to get it on to YouTube.

Part II

Part III

SWX PHP and SWX ActionScript Library Version 1.0 Released

SWX PHP 1.0 and SWX ActionScript Library 1.0 Release Announcement

It's my great pleasure to announce that after six months of alphas and betas, SWX PHP 1.0 and SWX ActionScript Library 1.0 are now available for download.

SWX is officially out of beta!

The major changes from SWX PHP Release Candidate 1 include a revamped Start Page with new, royalty-free icons, and a friendly new list view for the Services and Flash examples folders.

I've also updated the SWX Nabaztag API so that you can now specify the voice that you want your Nabaztag bunny to talk in and you can move its ears and send it ear and LED choreographies. You can test out and use the SWX Nabaztag API and the other SWX APIs (Flickr, Twitter, etc.) directly from the Public SWX Gateway using the SWX Service Explorer.

Finally, there's a new LOG_ALL configuration option in swx_config.php that determines whether non-error (status, info, profiling) messages are written to the PHP error log. Set this to false on deployments for better performance. The setting defaults to true as it is useful for troubleshooting during development.

Update: Based on Jon MacDonald's suggestion (thanks, Jon!), I've also created a SWX PHP Deployment Bundle to make it easier for you to deploy SWX PHP to your server. Use the regular SWX PHP and SWX PHP MAMP Bundles to develop with and then deploy the lean-and-mean deployment bundle to your server. The deployment bundle is much smaller than the regular build as it doesn't contain the source code for the Flex-based tools or the sample Flash FLA files.

The release of SWX PHP 1.0 and SWX ActionScript Library 1.0 is something I've been looking forward to for quite a while now and I hope that SWX simplifies your development life and makes it as fun for you to create Flash and Flash Lite applications and mashups as it has for me.

In the next two months, I'm going to be traveling around the world to talk about SWX at FlashForward Boston, FlashForum Conference in Germany, MAX Chicago, MAX Barcelona, FITC Hollwood, MAX Japan, and Flash on the Beach in my home town of Brighton, in the UK. In addition to this, development work continues (I just made my first post-1.0 commit to the SVN repository) and will include efforts to create a Flash 9 version of SWX PHP, as well as SWX RPC implementations for Ruby, Python, J2EE, and .Net.

In the next few days, I will be releasing Internet Drafts for SWX and SWX RPC which I hope will become Informational RFCs.

Here's to Version 1.0! This is just the beginning.

Read the full release notes for SWX PHP 1.0 and download the 1.0 release.

Heads up: SWX Beta 1 on Wednesday this week

Yep, you heard right: Beta 1. No more Alphas! I'm skipping Alpha 0.3 and going directly to Beta 1.

SWX has been progressing faster than I imagined and I feel it's now ready for Beta.

What does that mean? Well, it means that it's pretty much feature complete and the API, which will be introduced in Beta 1, shouldn't change dramatically. This doesn't mean that it won't change at all during the beta process and that new features won't be added, it just means that I will make a greater effort to make sure that existing applications do not break.

Also, during the Beta process I will be concentrating very heavily on creating documentation, tutorials, screencasts, etc. In short, everything and anything to make sure that SWX is easy as pie to get up and running with.

I am also almost ready with the SWX MAMP Bundle, which will allow developers on OS X a simple three-step process for getting started with SWX:

  • Download and mount the DMG.
  • Drag the SWX MAMP Bundle to your Applications folder.
  • Start the server.

The SWX Start Page appears automatically once the server has started and you have a full development server with Apache, PHP, etc. and SWX installed and running.

I will most likely release the SWX MAMP Bundle a little after the release of SWX Beta 1. Perhaps the same day, perhaps a day later (I'm also in the throes of moving house this week so I might not be able to manage a simultaneous release of both components -- or maybe I will!) Regardless, they'll both be released this week.

The biggest new feature in this release will be the new SWX API and library. Still very lightweight, the SWX API makes it easy to build data-driven applications without having to worry about the lower level details of the data exchange. Don't get me wrong, it's still very important that you understand these details (and they are so simple to understand in SWX that you actually can understand them without a degree in rocket science).

With this release, you will have three ways of using SWX.

First, you can use SWX without the API at all. That's right, you can use SWX without importing a single class or a single line of library code. SWX is native, remember. All you need is loadMovie(). (Man, that would make a great t-shirt!)

Here's a simple example that does not use the SWX API at all:

Note: As of beta one, the arguments property will become args. See this post for more information on this change.

// dataHolder is a movie clip on the stage.
dataHolder.serviceClass = "Twitter";
dataHolder.method = "getNumFriendsUpdates";
dataHolder.args = '["aral", 5]';
dataHolder.debug = true;
 
dataHolder.loadMovie("http://swxformat.org/php/swx.php", "POST");
 

That's all there is to it!

The code above calls the getNumFriendsUpdates() method in the SWX Twitter API (the Twitter class in PHP) and passes it the string "aral" as the first argument and the number 5 as the second argument.

In other words, there is a class (in the php/services folder) of swxformat.org that has a method that looks something like this:

 
class Twitter
{
    function getNumFriendsUpdates($userName, $n = 20, $since = NULL)
    {
        // Calls the official Twitter API and gets a list of friends
        // ...
    }
 

And you use the above code in ActionScript to call that method and have the results returned to Flash. The results are returned in a SWX SWF file, as native Flash objects that you can start using right away without having to deserialize them.

(You can test the methods in your service classes online, without writing any Flash code, by using the PHP Service Browser in SWX. Try it now!)

Notice how you have to encode your arguments in JSON format yourself. Although this is simple enough for simple arguments as in this sample, you probably won't want to do this when passing more complicated arguments.

Notice also that you the code sample here isn't checking for the result.

You can see the result in the SWX Analyzer since debug mode is on but you will want to check that the data has loaded and do something with it in your application also. The simplest way to do this is to use setInterval() to check getBytesLoaded() and getBytesTotal() on the dataHolder movie clip at regular intervals. Once the data has loaded, dataHolder.result will contain the loaded data (in this case, my last five friends' updates) in a regular ActionScript array.

To access the text of the first update, for example, you would reference it as dataHolder.result[0].text.

This example shows you how native SWX truly is. You can use it without any libraries or classes. It also means that you can easily build your own APIs on top of SWX or incorporate SWX into your existing frameworks very easily. By reading this example, you already know how SWX works. That's all there is to it! Yes, it's actually that simple!

The big disadvantage to not using the SWX API at all is that you have to manually serialize your arguments in JSON format. That's doable when your arguments are simple, as in this example, but not so if you wanted to send, say, a large array of objects. In this case, you can use the second method that's available: The minimal SWX API.

Here's how the same code would look using the minimal SWX API:

import org.swxformat.SWX;
 
// dataHolder is a movie clip on stage.
dataHolder.serviceClass = "Twitter";
dataHolder.method = "getNumFriendsUpdates";
dataHolder.args = ["aral", 5];
dataHolder.debug = true;
 
SWX.prepare(dataHolder);
 
dataHolder.loadMovie("http://swxformat.org/php/swx.php", "POST");
 

There are three differences here:

  • When using the minimal SWX API you have to import the SWX class.
  • You don't serialize the arguments you're sending to the server side service method manually. Instead, you set the arguments property on your dataHolder movie clip to an ActionScript array.
  • You call the static prepare() method on the SWX class, passing it a reference to your dataHolder movie clip. The prepare() method will serialize the array of arguments into JSON format for you.

So that's all it means to use the minimal SWX API. Basically, you're just importing the SWX class to use a single method: the prepare() method which serializes your arguments into JSON format for you.

You still have to check for load progress, however. Also, if you're building a Flash Lite application, you have to make sure that you queue your loadMovie requests so that only one loadMovie is happening at once so that you don't choke the device that it's running on (some devices actually cannot handle more than one loadMovie call per frame and nearly all of them will choke on multiple loadMovies). It's a good idea to queue your loadMovie calls in any case, even for desktop applications, as the HTTP 1.1 spec limits you to two successive downloads in any case.

So that's a lot of code you have to write to manage the download of the SWX SWFs. Well, it would be, if it wasn't for the new SWX API (taadaa!)

I will, of course, be writing at length about the new API and documenting it with the release of the Beta but here's a heads up.

The SWX API helps you by proving the following functionality:

  • Automatically queues your data load calls so that they occur one at a time.
  • Allows you to cancel a data call.
  • Provides easy to use callbacks for the progress, result and timeout events.

Here's the same sample application but using the full SWX API this time and with the handler methods for the various events:

import org.osflash.SWX;
 
// Create the SWX object.
swx = new SWX();
swx.gateway = "http://swxformat.org/php/swx.php";
swx.encoding = "POST";
swx.debug = true;
 
// And the method parameters object.
var methodParameters:Object =
{
	serviceClass: "Twitter",
	method: "getNumFriendsUpdates",
	args: ["aral", 1],
	progress: [this, progressHandler],
	result: [this, resultHandler],
	timeout: [this, timeoutHandler]
}
 
// Make a SWX call.
swx.call(methodParameters);
 
//
// Event handlers
//
 
function progressHandler(event:Object)
{
	trace (event.bytesLoaded + " of " + event.bytesTotal + " loaded...");
}
 
function resultHandler(event:Object)
{
	trace ("The first update is " + event.result[0].text);
}
 
function timeoutHandler(event:Object)
{
	trace ("The data call timed out for loader: " + event.target);
}
 

The full SWX API definitely makes things easier. For starters, you can specify callbacks for progress, result and timeout. And, behind the scenes, SWX manages the queuing of calls for you.

Notice how you are no longer working directly with movie clips and loadMovie(). Instead, you create a SWX object and set the gateway, encoding type (GET or POST) and other properties there. Then, you create a separate methodParameters object that contains the details of the method call you want to make to the server side.

In the methodParameters object you specify the server-side service class you want to instantiate, the method on that instance that you want to call and the arguments you want to pass to that method. You also specify any event handlers that you want to use.

Notice how you set the event handlers in the methodParameters object: Each handler is defined in an array where the first element is a reference to the scope of the event handler method (the object that the function is attached to) and the second element is a reference to the function itself. This is necessary since we don't have what is known as "method closures" in ActionScript 2 (we do in ActionScript 3, but that's another story). What this means is that unless you tell SWX where your event handler lives, it will have the incorrect scope when it gets called. You may have heard of a class called Delegate that is used as a workaround in these situations. I decided not to force you to use the Delegate class as I find that the array notation is easier to use (you don't have to import yet another class and there's less code.)

If you are building Flash Lite applications with SWX (and many of you will be since it's the best solution for creating data-driven applications with Flash Lite), make sure you use the new API. Also, if you're interested in digging deeper, that a look at the LoadManager and ExternalAsset classes that come with it as they will be useful to you if you have to load other external assets (JPEG, SWF files, etc.) in your Flash Lite applications. There is also a handy FrameLoop class in there that you'll need in Flash Lite.

Wow -- this was supposed to be a tiny heads up and it's grown into an essay of sorts!

So, basically, SWX Beta 1 is just around the corner and it's going to be great! Now I need to get to bed so I can get up and finalize this release tomorrow.

A taste of what’s to come

I'm way too tired to make a release tonight but here's a taste of some of what you're going to get in the next release of SWX tomorrow, starting with a look at the SWX Analyzer:

SWX Analyzer in 0.1.9

Notice the new History panel? Data that you receive is now kept in a history so you can go back to previous packets. But that's a very small addition compared to the big news, which is:

SWX is now fully interoperable with Amfphp (no joke!). This means that you can use existing Amfphp services without modification with SWX. This was one of the core design constraints for SWX and Patrick's email today lead me in the right direction (thanks, man) -- oh boy, no one's going to believe this after the April Fool's Day joke are they?

Beyond that I've added basic support for PHP objects (they are currently converted to associative arrays). Full support for custom class instances might be in the future but if I do implement it, I want to do it right and it's really not a priority right now.

I'm going to release 0.1.9 tomorrow. After that, I'm going to work on adding cross-domain support to SWX SWFs and with that, we should reach the 0.2 release.

In between all this, I want to develop a FlashLite client with SWX as building FlashLite apps is one of the most important use cases for SWX (there is no Flash Remoting on FlashLite.)

But right now I'm going to finish judging the few AIGA sites I have left and then hit the sack.

My weekend, by Aral Balkan

I took the last two days off (for the most part) to rest the 'ol hands and attend to some other affairs (accounting, taxes, and all that good stuff) after about three weeks of constantly working on SWX. I'm back to work today, taking part in Episode 6 of the .net magazine podcast, judging entries for the AIGA 100 Show, and, of course, evolving SWX, so expect some developments in the rest of the week.

On a completely unrelated note: How cool was the Apple/EMI announcement this week? It's great to be present at the first crack that will eventually spell the end of DRM -- it was about time! :)

Finally, here's a big thank-you to everyone who has written in, both on this blog and to me personally, with words of encouragement and support for SWX. I am slowly getting round to answering your emails so please bear with me as I work my way through them.

Go SWX! :)

A new chapter: Patrick Mineault joins SWX

* * * April Fool's Day - Joke Alert! * * * This is not a serious post! * * *

What a crazy week this has been! First, I released a new data exchange format for Flash called SWX. It was generally very enthusiastically received but Patrick Mineault was not impressed. Just when I'd thought that we'd mostly agreed to disagree on the matter, I got an email this morning from Patrick that put a smile on my face. Apparently, on further thought, Patrick's decided that SWX is a good idea after all and suggested that we merge it with Amfphp.

So, it's my great pleasure to announce Swxamfphp, pronounced Swix-Amph-H(i)p.

Our initial thoughts are to send SWFs to the Remoting gateway and see how that works out. Based on the results of those feasibility studies, we're considering embedding Remoting calls inside SWX SWF files and sending them to the Amfphp JSON endpoint over UDP before moving on to remoting entire movie clips. There's just so much potential here -- I can't explain how exciting this is.

I've also seen some amazing feedback on SWX from the web and wanted to share some of my favorites with you:

Mike Downey: "This is such an exciting time for the Flash Platform. I just know that Apollo is going to change everything."

Mike Chambers: "I have seen the future. And this is it. I'm definitely going to be using Apollo exclusively from now on."

Guy Watson: "This is great news! Go Apollo!"

Ryan Steward: "If I had two columns, I'd cover this in both. Apollo rocks!

Jesse Warden: "There's pimp-tight an' then dere's bettah, Apollo iz bettah than da bomb. Peep this shit!"

Thanks guys. It's all quite overwhelming! :)

SWX Alpha 0.1e released with manual PHON serializer

SWX Alpha 0.1e is now available for download.

What's new in Alpha 0.1e:

  • Added manual PHON serializer.
  • Modified echo sample application to use the manual PHON serializer.
  • Moved the automatic serializer to the AutoPhpSerializer class. It's still there but you can choose whether you want to use it. I may remove this in future iterations.
  • Modified the SWX gateway to handle null values. The auto serializer was sending them over as undefined.

This release introduces a slightly modified workflow for working with SWX. I don't believe that it is more complicated though (and may even be clearer.)

Find out more about SWX Alpha version 0.1e and see a code sample of the new workflow on the SWX web site.

Rediscovering fun

Rediscovering fun and SWX at the London Flash Platform User Group

Yesterday was a big day (25 hours would you believe). I finally revealed the tangent I've been working on for the past two-and-a-half weeks or so: SWX -- a new data exchange format and related workflow and tools. I also presented a brand new talk I'm evolving titled "Rediscovering fun" at the London Flash Platform User Group meeting in London (and had great fun doing so!). I've decided that this is the talk I'm going to evolve at the conferences I'm attending this year (which reminds me, I need to tell them that ASAP!)

Today, I'm back to working on SWX (what, you thought it was over with the initial alpha release? Far from it!) The first major show-stopper I'm tackling is the lack of PHP 4 support and, as far as I can tell, it was down to my using a *single* PHP 5 function (*doh!*). Looking at it last night and a little earlier this morning, it looks like the problem is slightly hairier due to a bug with the unpack() method in PHP 4 (and some versions of PHP 5, apparently.) I should hopefully have that fixed in the next ten minutes or so and, following testing on both PHP 4 and 5, I will issue the SWX Alpha 0.1b release once that's done.

I also wanted to thank you for your kind words of support and encouragement, both on the blog and in personal correspondence. I'm so happy that so many of you find SWX as exciting as I do.






Bad Behavior has blocked 0 access attempts in the last 7 days.