상세 컨텐츠

본문 제목

3강. startDrag, stopDrag

Programming/ActionScript3.0

by 노란날. 2010. 12. 27. 01:06

본문

반응형


>>> 정의

 

startDrag ==> 객체를 이동할 수 있도록 해주는 메서드
객체.startDrag(중심점(생략안됨), 범위);

 

 

>>> ex



 

car_mc.addEventListener(MouseEvent.MOUSE_DOWN, onDown);
function onDown(e:MouseEvent):void{
 car_mc.startDrag(true);
}
car_mc.addEventListener(MouseEvent.MOUSE_UP, onUp);
function onUp(e:MouseEvent):void{
 car_mc.stopDrag();
}

 

 

Tip.

 

- 무비클립을 마우스 포인터로 사용하기



 

car_mc.startDrag(true);
//마우스 포인터를 숨김

Mouse.hide( );

 

 

 

- mask 씌우기 





//mask 할 무비는 color 탭의 type을 Radial 로 하고 흰색포인트 alpha값을 0 으로 지정한다

//cacheAsBitmap 을 true로 설정해주어야 Flash Player에서 무비 클립의 내부 비트맵 표현을 캐시합니다

star_mc.cacheAsBitmap = true;
black_mc.cacheAsBitmap = true;
//mask

black_mc.mask = star_mc;

 

 

반응형

관련글 더보기