简体   繁体   English

闪光灯-按钮控制

[英]Flash - Button control

I am doing a simple Flash button that controls the playing of a moving clip. 我正在做一个简单的Flash按钮,用于控制移动剪辑的播放。

I want the movie to go to frame one and play when I mouse over the button and I want it to go to frame 12 and play when I mouse out. 我希望电影移至第一帧并在将鼠标悬停在按钮上时播放,我希望电影移至第12帧并在移出按钮时播放。 I have stop(); 我有stop(); at frames 1, 12 and 25 to prevent looping. 在第1、12和25帧处以防止循环播放。

The mouse_over part works fine, but the mouse_out part is unresponsive. mouse_over部分工作正常,但是mouse_out部分没有响应。

Here is my actionscript: 这是我的动作脚本:

stop();

button_btn.addEventListener(MouseEvent.MOUSE_OVER, playMovie);
button_btn.addEventListener(MouseEvent.MOUSE_OUT, unwindMovie);

function playMovie(evtObj:MouseEvent)
{
gotoAndPlay(1);
}

function unwindMovie(evtObj:MouseEvent)
{
gotoAndPlay(12);
}

I would appreciate some help figuring out why this will not play properly. 我希望能得到一些帮助,弄清楚为什么它不能正常播放。

Thanks. 谢谢。

I found my answer. 我找到了答案。 The button was covering the entire surface of the swf file and therefore the file had no way of knowing that the mouse had left. 该按钮覆盖了swf文件的整个表面,因此该文件无法知道鼠标已离开。 I will still give credit to Tyler because I wouldn't have figured this out without his help. 我仍然要归功于Tyler,因为没有他的帮助我就不会明白这一点。 Thanks. 谢谢。 Tyler. 泰勒。

I'd like to see more of your code. 我想看更多您的代码。 I am assuming this is on the timeline, so my first question is, "Whre is the code?" 我假设这是在时间轴上,所以我的第一个问题是:“代码在哪里?”

Timeline code responds to keyframes as well, so if it exists in one place, but not at the next keyframe, it will be unresponsive. 时间轴代码也会对关键帧做出响应,因此,如果它存在于一个位置而不是下一个关键帧,则它将无响应。 A good stratagy is create one layer with no keyframes/graphics that holds all this kind of code, that way it will always be available. 一个好的策略是创建一个没有关键帧/图形的图层来保存所有此类代码,这样它将始终可用。

But let me know some more info if the above isn't the issue, andwe can sort it out. 但是,如果上述不是问题,请让我知道更多信息,我们可以进行整理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM