public class MyTitleWindow extends TitleWindow { public function MyTitleWindow() { super(); } override protected function moveArea_mouseDownHandler(event:MouseEvent):void { startDrag(false, new Rectangle(0, 0, this.parentApplication.width - this.width, this.parentApplication.height - this.height)); super.moveArea_mouseDownHandler(event); } override protected function moveArea_mouseUpHandler(event:Event):void { stopDrag(); super.moveArea_mouseUpHandler(event); } override protected function moveArea_mouseMoveHandler(event:MouseEvent):void { if(this.x<=0||this.y<=0||this.x>=(FlexGlobals.topLevelApplication.stage.stageWidth-this.width)||this.y>= (FlexGlobals.topLevelApplication.stage.stageHeight-this.height)) { event.stopImmediatePropagation(); }else { super.moveArea_mouseMoveHandler(event); } } } 如代码中所示,重载titleWindow中的3个方法。 如果还要进一步改进效果的话,可考虑进一步重载moveArea_mouseMoveHandler,以实现当鼠标超出舞台时,窗体沿舞台边界移动。