在初始gotoAndStop()之后无法转移到另一个帧;

时间:2015-04-14 18:03:55

标签: actionscript-3 flash adobe flash-cs6

您好我正在尝试制作一个有菜单的Flash网站。但问题是gotoAndStop();转移到另一个帧后无效,无法选择该子菜单中的项目。这就是我所说的。

假设我选择了闪存作品,然后进入该帧,之后我无法选择第二张图片中的任何项目,即使我已经有一个事件监听器。

第一张图片:

1st image

第二张图片:我无法点击此部分的任何内容。这是我点击闪光灯时出现的情况。 enter image description here

这是我的代码。

//this is the flash works button
flashworks_btn.addEventListener(MouseEvent.CLICK, goflashworks);
function goflashworks(event:MouseEvent):void{
    gotoAndStop(2);
}

//let's say i picked basic animation
basicanimation_btn.addEventListener(MouseEvent.CLICK, gobasicanimation);
function gobasicanimation(event:MouseEvent):void{
    gotoAndStop(10);
}

修改

import flash.events.MouseEvent;

stop();
//homepage
home_btn.addEventListener(MouseEvent.CLICK, gohome);
flashworks_btn.addEventListener(MouseEvent.CLICK, goflashworks);
aboutdev_btn.addEventListener(MouseEvent.CLICK, goaboutdev);

//flashworks
basicanimation_btn.addEventListener(MouseEvent.CLICK, gobasicanimation);
layersandsymbols_btn.addEventListener(MouseEvent.CLICK, golayersandsymbols);
interactive_btn.addEventListener(MouseEvent.CLICK, gointeractivebutton);

//about developer
profile1_btn.addEventListener(MouseEvent.CLICK, goprofile1);
profile2_btn.addEventListener(MouseEvent.CLICK, goprofile2);

//basic animation
shapetween_btn.addEventListener(MouseEvent.CLICK, goshapetween);
motiontween_btn.addEventListener(MouseEvent.CLICK, gomotiontween);
classictween_btn.addEventListener(MouseEvent.CLICK, goclassictween);
back_flashworks_btn.addEventListener(MouseEvent.CLICK, goback_flashworks);

//layers and symbols
guidelayer_btn.addEventListener(MouseEvent.CLICK, goguidelayer);
masklayer_btn.addEventListener(MouseEvent.CLICK, gomasklayer);

//amazing effect button
amazingbuttoneffect_btn.addEventListener(MouseEvent.CLICK, gobuttoneffect);

//function home page
function gohome(event:MouseEvent):void{
    gotoAndStop(1);
}
function goflashworks(event:MouseEvent):void{
    gotoAndStop(2);
}
function goaboutdev(event:MouseEvent):void{
    gotoAndStop(3);
}

//function flashworks
function gobasicanimation(event:MouseEvent):void{
    gotoAndStop(10);
}
function golayersandsymbols(event:MouseEvent):void{
    gotoAndStop(11);
}
function gointeractivebutton(event:MouseEvent):void{
    gotoAndStop(12);
}

//function about developer
function goprofile1(event:MouseEvent):void{
    gotoAndStop(13);
}
function goprofile2(event:MouseEvent):void{
    gotoAndStop(14);
}

//basic animation function
function goshapetween(event:MouseEvent):void{
    gotoAndStop(20);
}
function gomotiontween(event:MouseEvent):void{
    gotoAndStop(21);
}
function goclassictween(event:MouseEvent):void{
    gotoAndStop(22);
}
function goback_flashworks(event:MouseEvent):void{
    gotoAndStop(2);
}

//layers and symbols function
function goguidelayer(event:MouseEvent):void{
    gotoAndStop(23);
}
function gomasklayer(event:MouseEvent):void{
    gotoAndStop(24);
}

//interactive button function
function gobuttoneffect(event:MouseEvent):void{
    gotoAndStop(25);
}

1 个答案:

答案 0 :(得分:0)

谢谢,我设法解决了这个问题。事实证明,我需要在项目的不同帧中分离按钮的动作脚本,因为在解决它之前我做的第一件事就是我将所有按钮实例放在动作脚本层的一个帧中。