Actionscript 3 Flash CS6 Actionscript 3.0按钮翻转会强制movieclips无法控制地播放

Actionscript 3 Flash CS6 Actionscript 3.0按钮翻转会强制movieclips无法控制地播放,actionscript-3,flash,button,movieclip,rollover,Actionscript 3,Flash,Button,Movieclip,Rollover,对于AdobeFlashCS6的ActionScript3.0,我是个初学者。我正在尝试为一个web公文包制作一个基本的、简单的动画交互徽标,在尝试修复徽标中三角形的滚动问题时遇到了一个问题。通过我自己学习的当前编码,我能够通过电影剪辑而不是按钮获得动画和反应。但是,此方法的执行会导致舞台上最前面的电影剪辑的“点击框”播放其动画,即使您试图将鼠标悬停在其后面的电影剪辑上 以下是相关网页: 请注意,当您滚动黄色三角形的左角或下角时,蓝色的“游戏”动画或绿色的“技能”动画将淡入并播放,而不是黄色的

对于AdobeFlashCS6的ActionScript3.0,我是个初学者。我正在尝试为一个web公文包制作一个基本的、简单的动画交互徽标,在尝试修复徽标中三角形的滚动问题时遇到了一个问题。通过我自己学习的当前编码,我能够通过电影剪辑而不是按钮获得动画和反应。但是,此方法的执行会导致舞台上最前面的电影剪辑的“点击框”播放其动画,即使您试图将鼠标悬停在其后面的电影剪辑上

以下是相关网页:

请注意,当您滚动黄色三角形的左角或下角时,蓝色的“游戏”动画或绿色的“技能”动画将淡入并播放,而不是黄色的“连接”动画

我试图通过尝试将电影剪辑转换为按钮来解决这个小而烦人的问题,当人们将鼠标移到形状上时,可以做出准确的响应。结果是,所有具有动画的电影剪辑都会不受控制地播放并循环其动画。从我所做的搜索来看,它与嵌套的电影剪辑有关

我花了太多的时间试图找出什么是错误的,以及如何自己解决问题,这就是为什么我寻求帮助、建议或见解,以解决重叠翻滚问题,或如何解决我的电影无法控制的播放问题

以下是我一直在使用的代码:

RedIFader.addEventListener(MouseEvent.ROLL_OVER, RedIOver);
RedIFader.addEventListener(MouseEvent.ROLL_OUT, RedIOut);
//RedIFader.addEventListener(MouseEvent.ROLL_OVER, RedIClick);

function RedIOver(event:MouseEvent):void{
    BioFadeIn.gotoAndPlay("BioFadeInOver")
    BlueAFader.gotoAndPlay("BlueAFaderOver")
    GreenAFader.gotoAndPlay("GreenAFaderOver")
    YellowNFader.gotoAndPlay("YellowNFaderOver")
}

function RedIOut(event:MouseEvent):void{
    BioFadeIn.gotoAndPlay("BioFadeInOut")
    BlueAFader.gotoAndPlay("BlueAFaderOut")
    GreenAFader.gotoAndPlay("GreenAFaderOut")
    YellowNFader.gotoAndPlay("YellowNFaderOut")
}

BlueAFader.addEventListener(MouseEvent.ROLL_OVER, BlueAOver);
BlueAFader.addEventListener(MouseEvent.ROLL_OUT, BlueAOut);
//BlueAFader.addEventListener(MouseEvent.ROLL_OVER, BlueAClick);

function BlueAOver(event:MouseEvent):void{
    GamesFadeIn.gotoAndPlay("GamesFadeInOver")
    RedIFader.gotoAndPlay("RedIFaderOver")
    GreenAFader.gotoAndPlay("GreenAFaderOver")
    YellowNFader.gotoAndPlay("YellowNFaderOver")
}

function BlueAOut(event:MouseEvent):void{
    GamesFadeIn.gotoAndPlay("GamesFadeInOut")
    RedIFader.gotoAndPlay("RedIFaderOut")
    GreenAFader.gotoAndPlay("GreenAFaderOut")
    YellowNFader.gotoAndPlay("YellowNFaderOut")
}

GreenAFader.addEventListener(MouseEvent.ROLL_OVER, GreenAOver);
GreenAFader.addEventListener(MouseEvent.ROLL_OUT, GreenAOut);
//GreenAFader.addEventListener(MouseEvent.ROLL_OVER, GreenAClick);

function GreenAOver(event:MouseEvent):void{
    SkillsFadeIn.gotoAndPlay("SkillsFadeInOver")
    RedIFader.gotoAndPlay("RedIFaderOver")
    BlueAFader.gotoAndPlay("BlueAFaderOver")
    YellowNFader.gotoAndPlay("YellowNFaderOver")
}

function GreenAOut(event:MouseEvent):void{
    SkillsFadeIn.gotoAndPlay("SkillsFadeInOut")
    RedIFader.gotoAndPlay("RedIFaderOut")
    BlueAFader.gotoAndPlay("BlueAFaderOut")
    YellowNFader.gotoAndPlay("YellowNFaderOut")
}

YellowNFader.addEventListener(MouseEvent.ROLL_OVER, YellowNOver);
YellowNFader.addEventListener(MouseEvent.ROLL_OUT, YellowNOut);
//YellowNFader.addEventListener(MouseEvent.ROLL_OVER, YellowNClick);

function YellowNOver(event:MouseEvent):void{
    ConnectFadeIn.gotoAndPlay("ConnectFadeInOver")
    RedIFader.gotoAndPlay("RedIFaderOver")
    BlueAFader.gotoAndPlay("BlueAFaderOver")
    GreenAFader.gotoAndPlay("GreenAFaderOver")
}

function YellowNOut(event:MouseEvent):void{
    ConnectFadeIn.gotoAndPlay("ConnectFadeInOut")
    RedIFader.gotoAndPlay("RedIFaderOut")
    BlueAFader.gotoAndPlay("BlueAFaderOut")
    GreenAFader.gotoAndPlay("GreenAFaderOut")
}

感谢您的时间和考虑。

我不确定我是否理解您的问题,但如果我理解,您可以这样做:

在翻滚处理程序上,将其他颜色
mouseEnabled
mouseChildren
属性设置为
false

RedIFader.mouseEnabled = false;
RedIFader.mouseChildren = false;
然后在推出时,将它们全部设置为true:

RedIFader.mouseEnabled = true;
RedIFader.mouseChildren = true;
这将防止其他颜色触发鼠标事件,直到鼠标离开当前颜色


如果这不是您的问题,那么我建议使用虚拟对象:

创建一个虚拟形状(alpha值为0),将其转换为movieClip,并将其放置在希望鼠标移动的位置。然后将滚动/传出侦听器添加到dummys。您可能希望在所有颜色对象上将
mouseEnabled
&
mouseChildren
设置为false,这样它们就不会碍事

//disable all the color buttons mouse interactions
RedIFader.mouseEnabled = false;
BlueAFader.mouseEnabled = false;
GreenAFader.mouseEnabled = false;
YellowNFader.mouseEnabled = false;
RedIFader.mouseChildren = false;
BlueAFader.mouseChildren = false;
GreenAFader.mouseChildren = false;
YellowNFader.mouseChildren = false;

//add listeners to the dummys
RedDummy.addEventListener(MouseEvent.ROLL_OVER,btnRollOver);
RedDummy.addEventListener(MouseEvent.ROLL_OUT,btnRollOut);
BlueDummy.addEventListener(MouseEvent.ROLL_OVER,btnRollOver);
BlueDummy.addEventListener(MouseEvent.ROLL_OUT,btnRollOut);
GreenDummy.addEventListener(MouseEvent.ROLL_OVER,btnRollOver);
GreenDummy.addEventListener(MouseEvent.ROLL_OUT,btnRollOut);
YellowDummy.addEventListener(MouseEvent.ROLL_OVER,btnRollOver);
YellowDummy.addEventListener(MouseEvent.ROLL_OUT,btnRollOut);

function btnRollOver(e:Event):void {

    if(e.currentTarget != RedDummy){
        RedIFader.gotoAndPlay("RedIFaderOver");
    }else{
        BioFadeIn.gotoAndPlay("BioFadeInOver")
    }
    if(e.currentTarget != BlueDummy){
        BlueAFader.gotoAndPlay("BlueAFaderOver");
    }else{
        GamesFadeIn.gotoAndPlay("GamesFadeInOver");
    }
    if(e.currentTarget != GreenDummy){
        GreenAFader.gotoAndPlay("GreenAFaderOver");
    }else{
        SkillsFadeIn.gotoAndPlay("SkillsFadeInOver");
    }
    if(e.currentTarget != YellowDummy){
        YellowAFader.gotoAndPlay("YellowAFaderOver");
    }else{
        ConnectFadeIn.gotoAndPlay("ConnectFadeInOver");
    }
}

function btnRollOut(e:Event):void {
    if(e.currentTarget != RedDummy){
        RedIFader.gotoAndPlay("RedIFaderOut");
    }else{
        BioFadeIn.gotoAndPlay("BioFadeInOut")
    }
    if(e.currentTarget != BlueDummy){
        BlueAFader.gotoAndPlay("BlueAFaderOut");
    }else{
        GamesFadeIn.gotoAndPlay("GamesFadeInOut");
    }
    if(e.currentTarget != GreenDummy){
        GreenAFader.gotoAndPlay("GreenAFaderOut");
    }else{
        SkillsFadeIn.gotoAndPlay("SkillsFadeInOut");
    }
    if(e.currentTarget != YellowDummy){
        YellowAFader.gotoAndPlay("YellowAFaderOut");
    }else{
        ConnectFadeIn.gotoAndPlay("ConnectFadeInOut");
    }
}

对我来说,这似乎是因为您的剪辑是三角形,可能使用了蓝色、绿色、黄色三角形和红色i(PNG格式图像?…)的图片

事实是,即使在PNG的透明区域上滚动,图片上的滚动也会被调度,这显然是在这里发生的事情

为了解决这个问题,您可以尝试使用这个类来解决这个问题

如果你不使用PNGs文件,解决方案就像从你的电影嘴唇的空白部分移除任何现有的矢量填充一样简单,即使是透明的