as3.0编程:鼠标的操作


取得鼠标的坐标:
Source:        
addEventListener(Event.ENTER_FRAME,xMouse);
function xMouse(evt:Event){        
        px.text = String(stage.mouseX);
        py.text = String(stage.mouseY);
}                        
确认鼠标是否被点击:
Source:        
stage.addEventListener(MouseEvent.MOUSE_DOWN,xDown);
stage.addEventListener(MouseEvent.MOUSE_UP,xUp);
function xDown(evt:MouseEvent):void{        
        mc.gotoAndStop(2);
}
function xUp(evt:MouseEvent):void{        
        mc.gotoAndStop(1);
}                        
替换鼠标的标志:
Source:        
Mouse.hide();
stage.addEventListener(MouseEvent.MOUSE_MOVE,xMove);
本文转自:http://www.5uflash.com/flashjiaocheng/Flash-as3-jiaocheng/1941.html

你可能感兴趣的:(html,编程,Flash,UP)