1.普通組件的拖動:
添加mouseDown和mouseUp事件,在down事件中寫入startDrag(),在up事件中寫入stopDrag()
2.spark的Panel組件的拖動:
添加id為pan,添加pan.titleDisplay.mouseDown和pan.titleDisplay.mouseUp事件如下,然后分別在down和up事件中寫入startDrag()和stopDrag()
pan.titleDisplay.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
pan.titleDisplay.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
添加mouseDown和mouseUp事件,在down事件中寫入startDrag(),在up事件中寫入stopDrag()
2.spark的Panel組件的拖動:
添加id為pan,添加pan.titleDisplay.mouseDown和pan.titleDisplay.mouseUp事件如下,然后分別在down和up事件中寫入startDrag()和stopDrag()
pan.titleDisplay.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
pan.titleDisplay.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);