1.添加WINDOW_MOVE事件,snapshotTool为myTool为窗体对象
myTool.addEventListener(TitleWindowBoundsEvent.WINDOW_MOVE,myMoveHandler);
2.
private function myMoveHandler(event:TitleWindowBoundsEvent):void
{
var currTarget:MyTool = event.currentTarget as MyTool ;
var x:Number = currTarget.x;
var y:Number = currTarget.y;
if (y >= this.parentApplication.height - 20)
{
currTarget.y=this.parentApplication.height - 20;
}
if (y <= 0)
{
currTarget.y=0;
}
if (x >= this.parentApplication.width - currTarget.width)
{
currTarget.x=(this.parentApplication.width - currTarget.width);
}
if (x <= 0)
{
currTarget.x=0;
}
}