I’m Reuben Stanton. This is an intermittent blog of relatively random things: thoughts about technology, reflections on my life and work, and some historical stuff.

My ‘real’ website is here, and I tweet intermittently @absent

Category: uncategorized

Sent from my iPad

I’m typing this on my new iPad which I purchased today. I’m using the open source wordpress app (which has it’s fair share of issues), but seems ok for basic text. I had plans for a big “first impressions” post, but i think that should wait until I’ve been playing around for a while – needless to say, first impressions are pretty good. The keyboard will take some getting used to, however.

I’m not sure how useful it will be for note taking/sketching (check my scientific accuracy test below) – I’m not giving up on pen and paper just yet.

UPDATE: (Not from my iPad)
I just stopped using the iPad and went back to using my regular laptop and for a few seconds I couldn’t work out why I kept scrolling the page in the wrong direction. And then it clicked – the scrolling gesture on the iPad and the gesture on the MacBook trackpad are exactly opposite.

On the iPad you scroll by moving the content to where you want it to go, while on the MacBook (and all trackpad devices) you are moving an imaginary cursor or “scroll bar” in the direction “you” want to move – the former seems so much more natural that the iPad managed to undo years of hard-wired assumptions in just a few hours and my brain was completely confused when I went back to a “normal” computer.

The effect of the direct interaction with content is nothing short of astonishing…

Baby Steps

I finished up for good as a Flash developer last week. A few years ago I really thought that Flash would become a viable application development platform and In some ways I’m truly sorry it didn’t work out. Oh well… as they say…. Upwards! Forwards! Towards the Sun!

“Don’t plan the plan if you can’t follow through” – Dr. Horrible

And just how do I think I’m going to change from being a Flash developer to an app developer and interaction designer? I’ve set myself a few modest goals:

Within 3 months I want to be confident writing Objective-C – I want to understand the language and the foundation framework the way that I understand ActionScript-3 now. From the small amount of Obj-C I’ve done so far I think this is achievable.

Within 6 months I want to feel comfortable with the iPhone and iPad development frameworks – by this time I want to feel confident designing an app and building it from scratch. I also want to use this time to explore (and re-learn) various design and development methodologies and practices – exploring idea generation methods, rapid prototyping, the user-centered design process (among others).

I’ve lined up a few projects to work on to get me started – I want to make sure I stay working in the “real world” as much as possible – making apps that people are actually going to use: I’m working on an iPhone app (in collaboration with Chris Marmo) to do with data mapping and tracking, and an iPad app (with Jeremy Yuille) exploring ideas around visual representation and organisation of knowledge (more on both of these later).

Create new

For the last 7 years I’ve been working as an “actionscript developer” or “flash developer” – a strange breed of programmer with a design background and no formal training. I became a programmer almost by accident – I was shuffled into flash development roles because I was looking for web design work at a time when flash was in high demand, and I had some skills in that area. The longer I stayed working in Flash, the longer I was branded as a developer, and in some ways, I just got stuck – it was to easy to keep working in a field where I could do well without struggling. For a while Flash was at the cutting edge of interaction design. For a while Flash was interesting.

But then I got tired. Over the last year I’ve begun to feel that Flash is a bit of a technological dead end. I’m no longer excited by the possibilities of Flash as a platform the way I am by iOS or HTML5. I think location aware technology is absolutely the way of the future and the iPhone is the perfect place to explore the fledgeling possibilities.

In my early graphic design and interaction design work (fresh faced and idealistic out of university), I loved the idea of designing small things and designing for small spaces – and what better small space to design for than one that you carry in your pocket?

I’m excited to be developing for new platforms. I’m excited to try and learn some real programming. And I’m excited to be desigining again.

Time

I resigned from my position at Flint yesterday. Major changes are afoot!

The Flash max-height issue

While working at Flint on the site for Paper Stone Scissors, I ran in to the little explored area of flash player 9’s maximum rendering area – the site uses JQuery to dynamically resize the flash HTML container to use browser scrollbars for long pages and unfortunately FP9 stops rendering graphics beyond 2880×2880 pixels… a bit of a problem where the site often scrolls to 4000px or more…

Redesign to use flash-based scrollbars wasn’t an option. After hours of messing around, I found a solution: use Javascript to keep the size of the flash within the renderable area, and fool the user in to thinking they are scrolling HTML content when they are actually scrolling the flash.

Do this by:
– Initially setting the size of the flash element to the desired full size (this sets the correct scrollbar size).
– While scrolling, use external interface to pass the scroll value of the browser in to flash.
Track the value in JS and in flash, and if the scroll value hits the maximum value:

  1. In Javascript – reset the size of the flash html element to the max renderable size
  2. In flash – as the browser scrolls, scroll the flash content container in the other direction (this keeps the flash content within the maximum render area)
  3. In Javascript – add padding to the top of the flash html element to keep the scroll position correct

I had a lot of trouble finding resources about this issue online, I hope this can help someone with the same problem.

WordPress and AS3, a few notes

UPDATE: My WordPress AS3 API is now available.

I’m about halfway through developing my WordPress / AS3 library and I thought I’d note down a few things that have come up during development.

Does anyone know their blogId?

The blogId parameter is required for most wp, mt, and metaweblog calls, yet there is no easy way for a user to find this out (you can’t get your blogId from the WordPress admin interface) – it seems the only way is through a call to wp.getUsersBlogs, using the data from the returned array to match up with the blog url that you are calling. I’ve simplified this process in my API so that whenever you make a webservice method call the api will check to see if a valid blogId is available, and if not, make the wp.getUsersBlogs call for you first.

Inconstencies

WordPress XML-RPC is inconsistent in the way it sends and retrieves some types of data. For example, categories are retrieved using wp.getCategories with the properties categoryName and categoryId, but if you use wp.suggestCategories you get category_name and category_id instead, meaning I have had to write duplicate parsing functions on a few occasions.

Null values

Ak33m’s XML-RPC library (correctly, I assume) serializes null properties to strings with a value of "null". This means  that when you send data to WordPress you can end up with “null” showing up everywhere – (A post with a category of “null” and a tag of “null”, a category with a slug of “null” etc). To avoid this I’ve had to create an IXMLRPC implementation for all of my WordPress structs that converts “null" to an empty string ("") before serialization.

Multiple authors

I haven’t worked out how to make metaweblog.getRecentPosts work with multiple authors. Because you have to authenticate using a username/password to make the call, you can only seem to retrieve posts by that particular author. I’m not sure how to get posts from multi-author blog without having to authenticate separately for each user, which is quite frustrating.

Apart from these minor issues, everything is going along smoothly though – I now have all post, category and page functions working correctly, options and comments to follow.

Simple mxmlc compiling on a Mac

The problem with being a flash developer from a traditional graphic design background is that there are some things that just don’t come naturally. One of these is working in a command-line environment.

I’ve been using the Flash IDE as my development environment on the Mac since Flash 4. Around the time of Flash 5 I started using BBEdit to edit external .as files, around MX I switched to TextMate for AS2 development, and now use TextMate exclusively for AS3 projects. But I’ve always used the IDE as my compiler, and there was always my designer’s preference to use the IDE to draw and layout objects rather than generate everything programatically. In developing my WordPress library I’ve been forced to bite the bullet and move to MXMLC, for the simple reason that the built in RPC libraries and Ak33m’s XML-RPC are only available for the Flex SDK.

I’m basically a total unix-command-line newbie, and there is a real dearth of information for people like me on how to command line compile in the mac environment. There is this tutorial by Senocular for the PC, and there are plenty of tutorials out there about using MXML, integrating shell commands to use ANT etc etc, but all of these assume you know what you are doing already.

I don’t know what I’m doing though. All I want is to be able to integrate the Flex SDK classes without having to purchase and learn Flex and MXML – I’ve discovered  that this is of course not only possible, but easy – not that you’d know it by looking online.

Here’s a way to do it

1. Download the Flex2 SDK from Adobe Labs

The Flex2 SDK is free! It includes the flex libraries and and the mxmlc compiler you will need to use the command line.

2. Put the Flex2 SDK somewhere sensible

I put mine in ~/Documents/Library/Flex/flex2_sdk_hf1/

3. Open a terminal window

Usually ~/Applications/Utilities/Terminal.app

4. Navigate to your project folder, eg:

cd Documents/Projects/my_flash_project/Development/

5. Run fcsh

Fcsh is the Flex Compiler SHell, a wrapper for MXMLC that makes compiling fast and easy. The simplest way to run this command is use the Finder to navigate to where you put the Flex SDK, find fcsh (in bin/fcsh) and drag and drop this file into your terminal window.

You should now see the following:

Adobe Flex Compiler SHell (fcsh)
Version 2.0.1 build 159086
Copyright (c) 2004-2006 Adobe Systems, Inc. All rights reserved.

(fcsh)

6. Compile your flash app using mxmlc

The syntax to use is:

mxmlc path/to/MainFileForYourApplication.as -sp path/to/source/folder -o relative/path/to/output/filename.swf

eg:

mxmlc src/com/reubenstanton/Main.as -sp src/ -o ../Deployment/main.swf

The output will be something like:

fcsh: Assigned 1 as the compile target id
Loading configuration file /Users/absent/Documents/Library/Flex/flex2_sdk_hf1/frameworks/flex-config.xml
../Deployment/main.swf (82769 bytes)

You see that last line ../Deployment/main.swf? If you navigate to this folder, you should see your swf sitting there! That’s it.

As you see above, fcsh Assigned 1 as the compile target id. This is just a shortcut to the compile command you just wrote – it means next time you want to compile you can just enter mxmlc 1 instead of typing the whole command again.

Now you can use Flex libraries in your flash projects without learning Flex and MXML.

This took me hours to figure out, so I hope it helps some of you out there.

Here are a few resources to help along the way:

WordPress and AS3 integration

UPDATE: The AS3 Library for the WordPress API is now available.

Recently I was searching around for an easy way to build a flash front-end for a WordPress managed website for a friend of mine. I was incredibly surprised to find that there doesn’t seem to be a properly integrated ActionScript library available for  WordPress XML-RPC, or if one is available, Google and the Actionscript community don’t seem to know about it.

So I’ve decided to build one.

I’ve had a little experience building ActionScript API libraries before when I was testing the Artbeat API with AQ – the Artbeat library has its flaws (not the least of which is no documentation of any kind), and I’ve learnt a lot from that experience.

My idea is single library that allows you to easily make all of the WordPress, MovableType, and Metaweblog API calls required to integrate flash with WordPress. I’m using Akeem Phillbert’s xml-rpc as3 library, as a base for the XML-RPC calls.

I’ll be posting my progress here as the library develops.

Archives