Flash - Button control
I am doing a simple Flash button that controls the playing of a moving clip.
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. I have stop(); at frames 1, 12 and 25 to prevent looping.
The mouse_over part works fine, but the mouse_out part is unresponsive.
Here is my actionscript:
stop();
button_btn.addEventListener(MouseEvent.MOUSE_OVER, playM开发者_开发问答ovie);
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. I will still give credit to Tyler because I wouldn't have figured this out without his help. 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.
精彩评论