Animate CC rollover/rollout button
What is the best way to create a button that plays the animation of a movieclip when rolling over it and then play reverse when rolling out of it.
What is the best way to create a button that plays the animation of a movieclip when rolling over it and then play reverse when rolling out of it.
That's unnecessarily complicated; you don't need to do anything in the HTML file. All you need is:
this.btn.addEventListener("mouseover", over.bind(this));
function over()
{
this.mc.gotoAndPlay("over");
}
this.btn.addEventListener("mouseout", out.bind(this));
function out()
{
this.mc.gotoAndPlay("out");
}
Update instance names (in red) as needed, and within the movie clip, set up frame labels called "over" and "out".
Working example here: Dropbox - overout
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.