我有一个名为内容的电影剪辑。我希望当鼠标悬停在按钮上时,内容显示出来并开始播放动画。现在,当我将鼠标悬停在上面时,它会播放影片剪辑,而当我将其滚动时,它会消失,这很好。但是问题是,下次我再次滚动时,什么也没有显示。任何的想法?先感谢您。
这是我的代码:
btn的代码
btn.addEventListener(MouseEvent.ROLL_OVER, test);
function test(event:MouseEvent):void{
content.visible=true;
content.play();
}
btn.addEventListener(MouseEvent.ROLL_OUT, test2);
function test2(event:MouseEvent):void{
content.visible=false;
}
影片剪辑的代码:
Stop(); // 1st frame
Stop(); // last frame
您应该使用gotoAndPlay()重播电影
function test(event:MouseEvent):void{
content.visible=true;
content.gotoAndPlay(1);
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句