views:

254

answers:

1

I created a simple transparent app for Adobe AIR in Flash. It has not chrome, so now I need to make it draggable. How could this be done? Thanks!

+1  A: 

This code is for the whole window draggable:

stage.addEventListener( MouseEvent.MOUSE_DOWN, startMove );

private function startMove( event : MouseEvent ) : void {
    stage.nativeWindow.startMove();
}

Other case, if you need just one little part of a window to accept MOUSE_DOWN event to start dragging, replace stage.addEventListener with movieClip.addEventListener and you are done.

Sergey Z.
I got this error: 1013: The private attribute may be used only on class property definitions.
Martti Laine
Oh damn it, my mistake. This works perfectly, thanks! :)
Martti Laine