Archive for July, 2007

Get up and running with SWX Beta 1.3!

This video requires Flash.

I released SWX Beta 1.3 today and recorded a new screencast to get you up and running with it.

The screencast covers installing and using the SWX MAMP Bundle but it applies equally if you're using your own development server.

The SWX MAMP Bundle contains everything you need to get up and running with SWX on a Mac (a full development server that contains Apache, PHP, MySQL, and, of course, SWX.)

If you already have a web server with PHP, you can download the much smaller zip file that just contains SWX and unzip it under your web folder and follow along with the screencast from there.

I hope you enjoy the screencast and the latest version of SWX. As always, your feedback is invaluable. Feel free to leave a comment here or join the SWX mailing list.

If you want to download the video, here's a direct link to the FLV.

Download SWX Beta 1.3 from swxformat.org.

SWX Beta 1.3 Released

I just released SWX Beta 1.3 which fixes issues we discovered during the first SWX Monday meet-up. It also adds a feature request from Folkert for more robust error messages and a fault handler in the SWX Full API.

Here are the full list of updates in Beta 1.3:

  • SWX gateway: Errors are now returned as Objects with error (boolean), errorNumber, and errorNumber properties.
  • SWX Full API: Added fault handler support. You add a fault handler just like result, progress, and timeout handlers. e.g., fault: [this, faultHandler] in the call parameters object you pass the swx call() method.
  • BaseService no longer shows up in the methods drop-down in Explorer for any of the APIs.
  • Added checks for safe mode and open basedir (CURL followlocation will fail in both these situations), and mod_security (cross-domain data access fails with default ruleset) that alert user potential problems instead of failing silently .
  • PHP 5: Fixed strict mode errors causing calls to fail (e.g. Flickr.getUserPhotos).
  • MAMP Bundle: Now defaults to the correct default directory on start up.
  • Flash examples: Saved all files in Flash 8 format.
  • Flash examples: Added .. to the classpath of all example FLAs so they compile out of the box.
  • Flash examples: Set mobile examples to FL 2.0 not 2.1 to be F8 compatible.
  • Flash examples: Removed old example files.

The new fault handler in the SWX Full API gets called with a fault object that has code and message properties.

Please note that the result handler will not get called when there is a fault.

If you have never installed the SWX MAMP Bundle and you have a Mac, I would appreciate it if you can confirm for me that the correct start page appears when you first run it (I'm finding it difficult to test this on mine as MAMP is caching the value somewhere.)

I am going to be recording new screencasts for SWX Beta 1.3 before my talk at the Boston Flash Mobile User Group this Friday.

Enjoy! :)

Notes following the first SWX Monday

I found last night's SWX Monday very useful as Seb and Ribot uncovered some issues with SWX that just weren't present on my own machine.

Here are a list of notes that I made during the meeting. Consider these an unofficial roadmap for the next point release of Beta 1.2 as I will be looking into them this week.

  • SWX MAMP Bundle does not default to the correct start page. The SWX MAMP bundle defaults to http://localhost:8888/MAMP instead of http://localhost:8888/. For the time being the workaround is to set the start page yourself to http://localhost:8888/ using the MAMP control panel -> Preferences -> Apache -> set document root to /Applications/MAMP/htdocs/. Update: This should now be fixed in SWX Beta 1.3. If you still see this behavior, please contact me as I'm finding it very difficult to reproduce this on my system.
  • Some Flash examples do not have the class path set in the FLA. The minimal API and full API examples do not have the class path set in the FLA and will not compile until you set the classpath to point to the /flash folder. To do this, go to Flash -> Preferences -> ActionScript -> ActionScript 2.0 Settings... and add the /flash folder (in the MAMP installation, this will be at /Applications/MAMP/htdocs/flash/) to your classpath. This folder contains the org.swxformat package that contains the SWX class used by the minimal API as well as the ExternalAsset and LoadManager classes used by the SWX full API. Update: Fixed in SWX Beta 1.3
  • The Flash Lite examples are set to publish for Flash Lite 2.1. Flash 8 doesn't come with this profile installed by default and, in a moment of temporary insanity, Adobe have made the installer for this Windows-only so Mac users with Flash 8 have no way of installing the Flash Lite 2.1 publish profile. Thankfully, the examples also work in Flash Lite 2.0 and the publish profile will be set to that version in future releases. In the meanwhile, set the publish profile to Flash Lite 2.0 yourself if you are using Flash 8. This should not affect you if you are using Flash CS3. Update: Fixed in SWX Beta 1.3.
  • The Data Analyzer does not work with mobile SWFs being tested in Device Central. Device Central appears to block LocalConnection requests. This stops you from seeing debug data in the Data Analyzer if you're testing your SWF from Device Central. I will be talking to some friends at Adobe about this so that it gets fixed in future releases of Device Central. In the meanwhile, a workaround is to publish your mobile application for Flash 7 or 8 while testing (remember to comment out fscommands so as not to get errors).
  • Flickr.getUserPhotos() failing on PHP 5. The Flickr.getUserPhotos() method fails when run on PHP 5 (the default in the current version of the SWX MAMP Bundle). In the meanwhile, you can use the SWX Public gateway (http://swxformat.org/php/swx.php) as it works from there (test it out using the public SWX Service Explorer) or run it on PHP4. The next release will fix this. Update: Fixed in SWX Beta 1.3.

As previously mentioned, I will be looking into these issues and releasing a new point release sometime this week.

Update: I've fixed the issues above in SWX Beta 1.3 (apart from the Device Central issue, which is something Adobe has to fix.) This latest Beta also introduces better error handling (a fault handler is available for you to use in the SWX Full API and separate fault codes and messages are returned in the fault object.

SWX Beta 1.2.2 Released

I just released another very minor point release of SWX. Download SWX Beta 1.2.2.

What's new in 1.2.2:

The SWX image on the start page was missing from previous Beta 1.2.x releases. If your aesthetic sensibilities can live with that, you don't need to upgrade from 1.2.1!

(I will be upgrading the SWX MAMP Bundle from 1.2 to 1.2.2, so you should upgrade to 1.2.2 if you're using the MAMP Bundle in order to get the changes in 1.2.1).

SWX Beta 1.2.1 released

I just released a minor point release of SWX, version Beta 1.2.1, in response to issues reported by Folkert (thanks as always, man) on Beta 1.2.

The changes in this minor point release are:

  • Explorer: Fixed name of Explorer SWF so it doesn't break on case-sensitive systems.
  • Explorer: Explorer: The results panel now hides when changing methods.

I will update the SWX MAMP Bundle shortly to Beta 1.2.1 but feel free to use Beta 1.2 in the interim as the case-sensitivity issue does not affect it.

SWX Service Explorer gotchas, workarounds and roadmap

Although I have implemented quite a few usability enhancements to it, there are still a few gotchas to watch out for when using the SWX Service Explorer in Beta 1.2.

One of these is that you must encode the values that you pass in JSON format yourself. This is a limitation in the original Amfphp service browser that the Explorer is based on. Mostly, this limitation will not affect you with simple data types but there are times when you will get erroneous results unless you this.

For example, if you are passing a string that begins with a number, you must surround it in double quotes to pass it as a string (or else it will be passed as a number and the string portion will be ignored).

To be safe, surround all string values in quotes. In other words, pass "hello, world" instead of hello, world.

You must also be aware of this limitation if you are passing arrays or objects as a value.

The next version of the SWX Service Explorer (Beta 1.3) will handle this encoding for you.

Another gotcha is that leaving an optional parameter's value empty in the Explorer will actually result in that parameter having an empty value, not the default value that's set in the service method. The workaround to this, currently, is to manually enter the default value in Explorer. The next version of Explorer will handle this properly.

Also, Folkert informed me today that the Results panel doesn't automatically close when you change methods. I just updated the Explorer in SVN to implement that and updated the SWX Service Explorer on the SWX public gateway to the latest version.

Finally, you can find the source for the SWX Service Explorer, which you can also use for your Amfphp projects as an updated version of the service browser (just change the gateway to point to gateway.php instead of amf.php) in SVN at http://svn1.cvsdude.com/osflash/swx/trunk/flex/Explorer/. (When I get a moment, I will make an Amfphp-specific build too).

SWX MAMP Bundle Beta 1.2 Released

Download SWX MAMP Bundle Beta 1.2 from the downloads page.

SWX Beta 1.2 available for download

I've just released SWX Beta 1.2. Get it from the download page.

What's new in Beta 1.2:

  • PHP Service Browser is now known as the SWX Service Explorer (or "Explorer" for short).
  • SWX Analyzer is now known as the SWX Data Analyzer (or "Analyzer" for short).
  • Implemented a consistent look and feel for the SWX Service Explorer and Data Analyzer.
  • Explorer: Replaces the methods grid with a drop-down box (usability).
  • Explorer: Now shows busy cursor on service calls (usability).
  • Explorer: Grouped action buttons into control bars (usability).
  • Explorer: Now defaults to the correct gateway URL (amf.php instead of gateway.php).
  • Explorer: You now get a friendly error message if the gateway cannot be found/is wrong and easy access to the Preferences window so you can change it.
  • Explorer: Now uses its own shared object and will not conflict with AMFPHP service browser.
  • Analyzer: Reduced size of header and made it consistent with Explorer.
  • Analyzer: The common LocalConnection-related conflict is now handled in a friendly way.
  • Added a new navigation bar to the Start Page and made it conform to the Beta 1.2 look and feel.

Most of the updates in Beta 1.2 focus on the new SWX Service Explorer (previously the PHP Service Browser).

I haven't updated the SWX MAMP Bundle to Beta 1.2 yet but will be doing so shortly (I'll blog an update when I do). I am also going to be recording a new screencast or two that use Beta 1.2. The current screencast features Beta 1.1 (you can still follow along in the meanwhile but the tools will look slightly different to the ones you see being demonstrated).

Get SWX Beta 1.2 from the download page.

SWX Mailing List is now open

I had been holding off on setting up a mailing list for SWX because it was very early days and I was very much heads-down focussed on developing SWX itself. As we stand on the eve of the release of quite a mature Beta 1.2, I believe it's time to open things up a bit more.

So, without further ado, I present to you, the SWX Mailing List.

I look forward to seeing how many of you are using SWX, what issues you're having, and what you're developing. Come, say "hi", hang out, and meet other SWXters.

Please excuse the dust: Updating the site, downloads, and screencast to Beta 1.2

I am updating the site, uploads, screencast, etc., to Beta 1.2 today so the site will be in Beta 1.1/Beta 1.2 limbo for a few hours. I will make a comprehensive post once SWX has fully entered Beta 1.2.

Update: A quick heads up: I've decided to implement a change to the SWX MAMP Bundle disk image too and it looks like this is going to push the release to tomorrow (Friday).



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