본문 바로가기

FLASH/AS3.0팁

드래그 앤 드롭 구현하기

무비클립을 드래그드롭하는 방법은 다음과 같습니다.


mc.addEventListener(MouseEvent.MOUSE_DOWN, mcDrag);

function mcDrag(event:MouseEvent):void
{
	mc.startDrag();
}

stage.addEventListener(MouseEvent.MOUSE_UP, mcDrop);

function mcDrop(event:MouseEvent):void
{
	mc.stopDrag();
}