/customers/iconara.net/iconara.net/httpd.www/blog/wp-content/plugins/wp-super-cache/wp-cache-phase1.php Iconara » 2006 » December

Archive for December, 2006

Architectural Atrocities, part 6: No, that is not a singleton

What does the classes Stage, Key, Mouse, Selection, ExternalInterface from the ActionScript 2.0 API:s have in common? They are bastadized singletons.

The really sad part is that of the five, three are still in the API:s in ActionScript 3.0 and of those Mouse and ExternalInterface are still bastardized singletons. Stage has been refactored completely and Key and Selection have been replaced or removed.

Read the rest of this entry →

New Nudie Jeans and Whipping Floyd collection sites

Just before christmas I released new sites for the Nudie Jeans and Whipping Floyd spring/summer collections.

Nudie Jeans Collection Spring/Summer 2007 The new Nudie Jeans Collection site

The Nudie Jeans collection site is a part of the Nudie Jeans site, for which I am webmaster (The Fit Guide, Videos and Gallery are by Kokokaka, but the rest I’m responsible for). It’s built for Flash 8, with a back-end in PHP which tells the presentation layer which items are in which category, what their names are and where all the images are located.

Whipping Floyd Site Spring/Summer 2007 The new Whipping Floyd Collection site

The Whipping Floyd site was designed by Magnus Heed of Whipping Floyd, I did the programming and animation. Since the site is quite animation-heavy I created most of the site using timeline animations, which I very rarely do.

It doesn’t have any loading sequences, and doesn’t really need any. Rather, it uses some clever loading scheduling to make sure that things are loaded before they are needed. It works really well if you have a broadband connection (which almost everyone in the target audience has).

The site is also fully bookmarkable and reload-safe, actually one of the first sites I made in this way (the core of the site was created half a year ago for the autumn/winter collection).


I started playing around with the Flex 2 command line compiler, and after an hour or so I finally get it: mxmlc can’t compile properly if the main class is in a package. WTF?

The bug is also described here.

In what world besides examples would you not want your main class to be in a package?

The Photoshop CS3 Installer is an Ajax-application

I just installed the Photoshop CS3 Beta, and there was something with the installer that made me curios. I checked the application bundle and found a Nib called “DHTMLAlert.nib”, which was a window filled with a WebView. In further inspection the “resources” directory which is on the install disk contains the interface, in HTML and JavaScript files. In essence, the installer is an Ajax application, at least the user interface.

I guess this is more common on the Windows platform, so perhaps I shouldn’t be surprised. On the Mac, however, we don’t see this very often, and I hope it will stay that way. Web applications are ten years after their desktop counterparts when it comes to user interfaces, so doing what Adobe is doing isn’t a step forward, in my opinion. I don’t want every application to have it’s custom GUI style, and I don’t want hover effects on every control, it’s not in the intrest of good user interface design.

But that wasn’t really why I wrote this, the real reason is that I’m curious if this is an example of what Adobe’s soon-to-be-released Apollo can do? It looks and feels kind of sleek, so I’m impressed. For some applications I can see why using this kind of technology would be better than trying to do the same thing in .Net or Cocoa.

Photoshop CS3 Beta installer window
It’s actually a web application

XSL, plists and a bit of JSON

Apple’s Cocoa API:s can save an object graph to file by using the plist format. In its modern form it’s an XML dialect, which should be a good thing — but it’s not.

Apple’s engineers had probably never heard of XSL when they dreamed up the format, because they made it needlessly difficult to transform.

In this post I’ll show you how to transform a plist file to a format that is easier to work with, and I’ll also show you how to transform that intermediate format into JSON, thus making a complete plist to JSON pipeline.

Read the rest of this entry →

Flash, Ajax and Google Analytics

Flash and Ajax applications don’t register in the server logs as the good old HTML-based websites did. I’ve hacked my own solutions to this, because it’s always interesting to know what visitors are doing, how many they are and what the find interesting.

To get server logs of a Flash or Ajaxified site, create a file on the server and load that file with a different parameter for every “page” you want to track. I put “page” in quotes since what consitutes a page isn’t always entierly obvious in the context of Flash and Ajax.

But, over the last year I have started to use Google Analytics, which is a rather good tool for getting an overview of your site’s statistics. Today I looked through the documentation and found a page named “How do I track Flash events”. It’s not rocket science, but I thought I’d share this knowledge with you.

It’s as simple as including the analytics JavaScript-snipplet as usual on the page that embeds the Flash application, and then call the tracker code from within Flash, Google suggests this code:


You can do it with the ExternalInterface, too, but the code above works fine.

I’m thinking of expanding my state handling class into a small module which provides different kinds of state handling, and something which automatically calls a server side script or the Google Analytics tracker code would definitely be included.