AIR: Making Draggable Windows
I've recently been working on my first AIR project and one of the things it had to include was dragging around your desktop with a transparent chrome (meaning there is no minimize/close/etc buttons). It is really simple to do in AIR (one line of code to do the actual dragging) so here it is:
Actionscript:
-
box_mc.addEventListener(MouseEvent.MOUSE_DOWN, doMouseDown);
-
-
function doMouseDown($evt:MouseEvent):void
-
{
-
this.stage.nativeWindow.startMove();
-
}
Keep in mind AIR is all AS3 so there is no AS2 alternative for this method. Also make sure to set up your file to output the transparent chrome by going to Commands > AIR Application & Installer Settings (if you've followed my tip on how to set AIR up in Flash CS3) and change the Window style to Custom Chrome (transparent).









