UPS Whiteboard ‘08 Launches

picture-4

After a few months of strategy, creative, and technology working together to make the next iteration of UPS’ Whiteboard website better than before, the website has officially launched.

While the ‘08 Whiteboard site is much more complex than the previous version, we had a great team working together to make it as good of an interactive experience as possible. The technology side includes a nice mix of Flash / AS2, Ruby on Rails, and almost half a gigabyte of video.

Check it out at http://whiteboard.ups.com.

Comments

Modifying request headers in ActionScript 3.0

Though Adobe’s documentation would have you think otherwise, setting or modifying the request headers in an AS3, browser-based Flash application is only possible under certain circumstances. I’m testing this with player version 9,0,115,0 in both Safari 3 and Firefox 2 for OS X.

The documented way to set request headers on an URLRequest object is the following:

var header:URLRequestHeader = new URLRequestHeader("myHeader", "headerValue");
var request:URLRequest = new URLRequest("http://www.[yourdomain].com/");
request.data = new URLVariables("name=John+Doe");
request.requestHeaders.push(header);

However, it seems like you can only modify the headers on a POST request. Which would mean we’d have to specify the POST method (assuming the remote site accepted POST requests for the URL):

request.method = URLRequestMethod.POST;

But even this isn’t sufficient, because the Flash Player will silently convert POST requests into GET requests if the request is empty. So now you have to add URLVariables to the mix:

var variables:URLVariables = new URLVariables();
variables.postVariable = "variableValue";
request.data = variables;

So the only way to successfully set or modify request headers on a URLRequest object is to set its method to POST, and make sure you send at least one variable along with the request. Otherwise the headers will silently remain unchanged.

This is unfortunate as it makes it difficult to connect a browser-based Flash application to a truly REST-ful Web service which determines the markup of content based on request headers.

Comments