/*舞台上有三个mc*/ import flash.events.MouseEvent; mc1.addEventListener(MouseEvent.MOUSE_DOWN,_onMouseDown); mc2.addEventListener(MouseEvent.MOUSE_DOWN,_onMouseDown); mc3.addEventListener(MouseEvent.MOUSE_DOWN,_onMouseDown); mc1.addEventListener(MouseEvent.MOUSE_UP,_onMouseUp); mc2.addEventListener(MouseEvent.MOUSE_UP,_onMouseUp); mc3.addEventListener(MouseEvent.MOUSE_UP,_onMouseUp); function _onMouseDown(e:MouseEvent):void { //trace(e.target.parent.numChildren-1) e.target.startDrag(); e.target.parent.setChildIndex(e.target,e.target.parent.numChildren-1); } function _onMouseUp(e:MouseEvent):void { e.target.stopDrag(); }