ActionScript按鈕事件

on (release){
 
 trace("鼠標擡起");
 //_root.gotoAndPlay(30);
}
on(press){
 trace("鼠標按下");
}
on(releaseOutside){
 trace("鼠標在外面擡起");

trace("鼠標X座標爲:"+String(_xmouse));
 trace("鼠標Y座標爲:"+String(_ymouse));
 //Mouse.hide();隱藏鼠標
 //Mouse.show();顯示鼠標
}
on(rollOver){
 trace("鼠標進入按鈕");
}
on(rollOut){
 trace("鼠標離開按鈕");
}
on(dragOver){
 trace("鼠標掠過");
}
on(dragOut){
 trace("鼠標拖動移出");
}
on(keyDown){
 if(Key.isDown(Key.LEFT)){
  trace("向左鍵按下");
  _x-=10;
 }
 if(Key.isDown(Key.RIGHT)){
  trace("向右鍵按下");
  _x+=10;
 }
 if(Key.isDown(Key.UP)){
  trace("向上鍵按下");
  _y-=10;
 }
 if(Key.isDown(Key.DOWN)){
  trace("向下鍵按下");
  _y+=10;
 }
}

trace("按下鍵盤的ASC碼爲:"+String(Key.getAscii()));
 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章