AboutFlex.net

flex,air,flash …

This example shows you how to drag an Air window from its content:

The Application:

<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication
	xmlns:mx="http://www.adobe.com/2006/mxml"
	layout="vertical" height="136" width="220">
	<mx:Script>
		<![CDATA[
			private function startDragApplication():void{
				stage.nativeWindow.startMove();

			}
		]]>
	</mx:Script>
	<mx:Button mouseDown="startDragApplication()" label="Drag Me!!"/>

</mx:WindowedApplication>

the relevant code:

	stage.nativeWindow.startMove();/*tells the nativeWindow to
			follow the mouse;it stops automatically*/

Add A Comment