David Harvey - Teams and Technology

As promised, here’s a small example of an application built using JavaScript and HTML, repackaged for the desktop using AIR. The application is a version of the puzzle game Black Box. There’s an online version of the game, an AIR package for download, and a zip with the source and the other game resources.
It’s implemented as a straightforward model/2 architecture: the major components are

a game model, which implements the core game domain concepts in JavaScript;

an HTML container and JavaScript view/controller, which translates clicks on
the game board into mesages to the model, and which in turn listens for
events on the model and responds - generally - by changing classes on the
DOM nodes which represent the affected game objects;

and a css file, in which all the DOM classes are mapped on to graphics and
other styles -all the graphic rendering of the program is done by CSS.

Firstly, create an AIR project in studio and copy or import the source files, libraries and other resources.

Secondly, export the project as an AIR package.

And that’s it. As it stands, it’s a pretty simple example of an AIR app - it’s not doing anything with the AIR APIs that are exposed to JavaScript, for example, nor does it have an online component, nor the auto-update facilities that AIR provides. However, all the JavaScript, HTML, CSS runs nicely in a window on the desktop, with the interaction, graphics and even the sound all present and correct (there’s a flash component in SoundManager2, but that’s one of the things the flash-based AIR runtime takes in its stride).

News

Courtesy of a system upgrade by my ISP a few things have broken here ... Main content and blog are happy, but links to some of the older items are not working... normal service will be resumed at some point (but likely not before I move the whole lot off the old Joomla on which it's currently running...)