This is an update to my earlier post Pixel to EM converter which focused on the online utility to convert ‘pixels’ to ‘ems’. I have updated the utility to support more units and it now can convert between any of the following units:
Pixel
EM
Point
Percent
You can also convert a CSS file contain any of all of the above units/formats to any of the desired format. I have also moved the utility to a more descriptive domain pixelconverter.kleptomac.com

Pixel Converter
Its been 6 months since I am working on this project and just when I thought I am done with it, I realize that I have been using Pixels in my stylesheets all the while and this doesn’t support the browser based “text size” settings (Internet Explorer). So, when the user changes the ‘text size’ settings, the font size of the applications doesn’t change. For this to work, all pixels now have to be modified to ‘em’ unit.
Em is considered to be a more effective way of representing layouts as it is relative to the body text/font size. This ensures that the aspect ratio of the layout is maintained even when the dimensions of the text changes (browser settings).
For me however, looking at the size and the number of the CSS files I had, this was a daunting task. A quick Google search showed a good number of articles on how to convert pixels to em, but all of them were mere number converters. I still would have to convert each pixel into em manually. I never had the patience to do that and therefore I wrote a small utility script that takes a CSS dump and converts all pixel values to em. The online version of this is available at pixel2em.kleptomac.com pixelconverter.kleptomac.com (An updated version of the tool is available now. Please refer to pixel converter post). I hope you will find it useful.

pixel2em
If you are used to using the ApplicationUpdaterUI class for providing the auto update feature for your AIR application, and have recently started to work on the new Native Process API in Adobe Air 2 beta for compiling into a Native app, you would realize that the auto update functionality just doesn’t work. This is because the ApplicationUpdaterUI is designed to work only for the default AIR applications (.air). If you want to provide auto update functionality for your executables (.exe), you need to rather use the ApplicationUpdater Class. You don’t have to modify the update.xml file. The only difference is since this is an executable, you can’t do an auto upgrade of the file. Rather, you will need to let the user download the file (if you are trying the update the .exe file). The most simplest way to do it is to capture the “UpdateStatus” event of the ApplicationUpdater and check if an update is available and then trigger a ‘navigateToURL”. Checking if there is a new version available can be done using the “StatusUpdateEvent.available” property. Here is the code that you can use.
private function checkForUpdate():void
{
appUpdater.updateURL=”<path>/update.xml”; // Server-side XML file describing update
appUpdater.addEventListener(UpdateEvent.INITIALIZED, onUpdate); // Once initialized, run onUpdate
appUpdater.addEventListener(StatusUpdateEvent.UPDATE_STATUS, onUpdateStatus);
appUpdater.addEventListener(ErrorEvent.ERROR, onError); // If something goes wrong, run onError
appUpdater.initialize(); // Initialize the update framework
}
private function onError(e:UpdateEvent):void
{
Alert.show(e.toString());
}
private function onUpdate(e:UpdateEvent):void
{
appUpdater.checkNow();
}
private function onUpdateStatus(event:StatusUpdateEvent):void
{
if( event.available ) {
// set an information text for the user
application.updateInfo.label = “An updated version ” +
event.version + ” is available. Click here to download.”;
// or directly display a download prompt
var urlReq:URLRequest = new URLRequest(“<url to the executable>”);
navigateToURL(urlReq);
}
}
Found an interesting POC of jQuery Desktop using HTML5, CSS and jQuery at SonSpring.com. Though the implementation is basic, its certainly going to trigger more ideas and could be a good way of designing management tools. jQuery is a great library for javascript and when mixed with HTML 5 and CSS can create magic.