追隨滑鼠的影片片段

//與滑鼠事件有所關聯的函數
function moveCircle (mevent) {

//將「Circle_mc」的 x 與 y 值以及事件舞台座標(滑鼠指標)的 x 與 y 值結合
circle_mc.x = mevent.stageX;
circle_mc.y = mevent.stageY;

}
//聯繫主舞台的 mouseMove 事件與函數
stage.addEventListener (MouseEvent.MOUSE_MOVE,moveCircle);


事件 MouseEvent的常數 說明
click MouseEvent.CLICK 當滑鼠單響一次
doubleClick MouseEvent.DOUBLE_CLICK 當滑鼠對物件雙響二次時
mouseDown MouseEvent.MOUSE_DOWN 對著物件按下滑鼠左鍵時
mouseUp MouseEvent.MOUSE_UP 對著物件放開滑鼠左鍵時
mouseOver MouseEvent.MOUSE_OVER 當滑鼠滑入物件時(只觸發一次,即便在物件上移動也不再觸發, 除非先滑出再滑入)
mouseOut MouseEvent.MOUSE_OUT 當滑鼠滑出物件時(只觸發一次)
mouseWheel MouseEvent.MOUSE_WHEEL 當滑鼠在物件時使用滾輪時
mouseMove MouseEvent.MOUSE_MOVE 移動滑鼠指標時
rollOver MouseEvent.ROLL_OVER 當滑鼠在物件上滑動時(每移動一次就觸發一次)
rollOut MouseEvent.ROLL_DUT 當滑鼠滑出物件時(只觸發一次)/TD>
arrow
arrow
    全站熱搜

    雞蛋貓異想世界 發表在 痞客邦 留言(1) 人氣()