2
所以我在Adobe Animate中開發一個項目,它是一個交互式地圖。ActionScript 3 EventListener和函數參數
我想要做的是當我將鼠標移到關鍵區域時彈出淡入淡出效果。例如,一個彈出窗口解釋了什麼可以在回收區域進行回收。由於存在多個回收站點,我創建了兩個功能,一個用於隱藏彈出窗口,另一個用於顯示它,並使用開關箱來確定哪個回收站點發生鼠標懸停事件。
因此,例如,設置Show事件像這樣:
function showShred(event: MouseEvent, shredNum: int): void {
switch (shredNum) {
case 1:
TransitionManager.start(shreddingInfo_flr3_1, {
type: Fade,
direction: Transition.IN,
duration: 3,
easing: Strong.easeOut
});
break;
case 2:
TransitionManager.start(shreddingInfo_flr3_2, {
type: Fade,
direction: Transition.IN,
duration: 3,
easing: Strong.easeOut
});
break;
case 3:
TransitionManager.start(shreddingInfo_flr3_3, {
type: Fade,
direction: Transition.IN,
duration: 3,
easing: Strong.easeOut
});
break;
}
}
所以我加入了事件偵聽器和他們只是造成錯誤,似乎並不喜歡這個功能需要一個參數。
shredBtn_Flr3_1.addEventListener(MouseEvent.MOUSE_OVER, showShred(1));
我對ActionScript 3.0非常陌生,所以對於任何幫助和提示都非常感謝!