我有一个幻灯片动画,其中包含 5 个图像(意味着获取 url 的按钮)在幻灯片影片剪辑中。到目前为止,我只创建了第一个图像的按钮。它不在影片剪辑中时有效;但是,一旦创建了包含该按钮的影片剪辑,它就不再起作用。
此外,这些按钮具有在影片剪辑内部或外部工作的翻转效果。如果按钮可以检测到影片剪辑内的鼠标悬停,为什么它不能检测到鼠标点击?
非常感谢任何建议。我不太精通 AS,所以你可能想把它弄得更笨一点。
动作脚本
var count = 1;
rtBtn.addEventListener(MouseEvent.CLICK, rightScroll);
lftBtn.addEventListener(MouseEvent.CLICK, leftScroll);
function panelOver() {
// this.onEnterFrame = scrollPanel;
// delete this.onRollOver;
}
function rightScroll(e:Event){
if (count < 5){
count++;
panel.x += 150;
}else{
count = 5;
}
//addEventListener(Event.ENTER_FRAME,rightAnimate);
//function rightAnimate(event:Event) {
//panel.x -= 140; //Math.round(140/7);
//}
}
function leftScroll(e:Event){
if (count > 1){
count --;
panel.x -= 150;
}else{
count=1;
}
//addEventListener(Event.ENTER_FRAME,leftAnimate);
//function leftAnimate(event:Event) {
//panel.x += 140;// - Math.round(.5);
//}
}
/* Click to Go to Web Page
Clicking on the specified symbol instance loads the URL in a new browser window.
Instructions:
1. Replace http://www.adobe.com with the desired URL address.
Keep the quotation marks ("").
*/
snowbtn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage_3);
function fl_ClickToGoToWebPage_3(event:MouseEvent):void
{
navigateToURL(new URLRequest("http://www.adobe.com"), "_blank");
}