2013-03-23 44 views
0

按鈕如何找到,如果鼠標移到在特定幀的按鈕不附加一個事件監聽器 像這樣(代碼在幀5):如何找到,如果鼠標移到在特定幀

on(button1.MOUSEOVER){ 
    //do some staff 
} 

或東西像這樣(代碼在第5幀):

button1.MouseEvent.MOUSE_OVER = function() { 
    //do some staff 
}; 

回答

1

OK!我找到答案(在外形5碼):

trace(button1.hitTestPoint(mouseX, mouseY, false)); 

在Button1的真實回報,否則返回false

if (button1.hitTestPoint(mouseX, mouseY, false)) { 
    //do some staff 
}