Copy link to clipboard
Copied
I've never used flash...so i'm total newb..
I have a gif animation about 11sec long with 5sec sound in html 5 canvas.
I would like to make it start the animation and sound when the mouse is on the image
and stop when mouse is out.
can somebody help me how to do that?
You do not have "action coding". Canvas documents use vanilla JavaScript, plus the CreateJS library for audiovisual tasks.
The whole point of using a button is that you DON'T need any of that code. Flash/Animate handles it for you automatically. You put the static image in the Up frame and the animated movieclip in merged Over and Down frames.
Copy link to clipboard
Copied
Things you will need to teach yourself to make this happen:
Copy link to clipboard
Copied
l have a layer that is changed to movie clip that goes the whole length of the animation.
and have action coding that goes
stage.enableMouseOver();
myLocalThis01 = this;
this.MouseTrk.addEventListener("mouseover", fl_MouseOverHandler);
function fl_MouseOverHandler()
{
myLocalThis01.play();
}
this.MouseTrk.addEventListener("mouseout", fl_MouseOutHandler);
function fl_MouseOutHandler()
{
myLocalThis01.stop();
}
like that.
do I need a transparent rectangle in the movie clip layer for it to work?
Copy link to clipboard
Copied
You do not have "action coding". Canvas documents use vanilla JavaScript, plus the CreateJS library for audiovisual tasks.
The whole point of using a button is that you DON'T need any of that code. Flash/Animate handles it for you automatically. You put the static image in the Up frame and the animated movieclip in merged Over and Down frames.