eWin_mc.title_mc.addEventListener(MouseEvent.MOUSE_DOWN, onStart);
nWin_mc.title_mc.addEventListener(MouseEvent.MOUSE_DOWN, onStart);
myCom_mc.title_mc.addEventListener(MouseEvent.MOUSE_DOWN, onStart);
function onStart(e:MouseEvent):void{
//trace(e.currentTarget.parent.name);
var mc:MovieClip = e.currentTarget.parent as MovieClip;
mc.startDrag(false);
this.addChild(mc);
}
eWin_mc.title_mc.addEventListener(MouseEvent.MOUSE_UP, onStop);
nWin_mc.title_mc.addEventListener(MouseEvent.MOUSE_UP, onStop);
myCom_mc.title_mc.addEventListener(MouseEvent.MOUSE_UP, onStop);
function onStop(e:MouseEvent):void{
var mc:MovieClip = e.currentTarget.parent as MovieClip;
mc.stopDrag();
}
eWin_mc.close_mc.addEventListener(MouseEvent.CLICK, onVisible);
nWin_mc.close_mc.addEventListener(MouseEvent.CLICK, onVisible);
myCom_mc.close_mc.addEventListener(MouseEvent.CLICK, onVisible);
function onVisible(e:MouseEvent):void{
var mc:MovieClip = e.currentTarget.parent as MovieClip;
mc.visible = false;
}
/*eIcon_mc.doubleClickEnabled = true;
eIcon_mc.addEventListener(MouseEvent.DOUBLE_CLICK, onWindow);
function onWindow(e:MouseEvent):void{
eWin_mc.visible = true;
}
nIcon_mc.doubleClickEnabled = true;
nIcon_mc.addEventListener(MouseEvent.DOUBLE_CLICK, onWindow2);
function onWindow2(e:MouseEvent):void{
nWin_mc.visible = true;
}
myIcon_mc.doubleClickEnabled = true;
myIcon_mc.addEventListener(MouseEvent.DOUBLE_CLICK, onWindow3);
function onWindow3(e:MouseEvent):void{
myCom_mc.visible = true;
}*/
eIcon_mc.doubleClickEnabled = true;
nIcon_mc.doubleClickEnabled = true;
myIcon_mc.doubleClickEnabled = true;
eIcon_mc.addEventListener(MouseEvent.DOUBLE_CLICK, onWindow);
nIcon_mc.addEventListener(MouseEvent.DOUBLE_CLICK, onWindow);
myIcon_mc.addEventListener(MouseEvent.DOUBLE_CLICK, onWindow);
function onWindow(e:MouseEvent):void{
var mc:MovieClip = e.currentTarget as MovieClip;
switch(mc){
case eIcon_mc :
eWin_mc.visible = true;
this.addChild(eWin_mc);
break;
case nIcon_mc :
nWin_mc.visible = true;
this.addChild(nWin_mc);
break;
case myIcon_mc :
myCom_mc.visible = true;
this.addChild(myCom_mc);
break;
}
}
5강. 부드러운 움직임을 이용, 마우스 포인터 만들기 (0) | 2011.01.13 |
---|---|
5강. 네비게이션 (0) | 2011.01.13 |
4강. for문을 이용한 도형맞추기 (0) | 2010.12.27 |
4강. hitTest를 이용한 갤러리 (0) | 2010.12.27 |
4강. hitTest를 이용한 네비게이션 제작 (0) | 2010.12.27 |