Copy link to clipboard
Copied
Hi.
I'm currently doing a assessment on adobe animate and I'm using buttons so that when you press them an animation starts. I've coded everything but when I test it in HTML5 none of the buttons appear. This is probably a easy fix but I'm really new to Adobe Animate so I have no clue what to do. This is what my code looks like.
//add event to check for buttons being clicked
this.btnPlayCough.addEventListener("click", playCough.bind(this));
this.btnPlayHandshake.addEventListener("click", playHandshake.bind(this));
this.btnPlayInfectedSurface.addEventListener("click", playInfectedSurface.bind(this));
this.btnPlayBkgd.addEventListener("click", playBkgd.bind(this));
function playCough() {
this.mcCough.gotoAndPlay("start");
}
function playHandshake() {
this.mcHandshake.gotoAndPlay("start");
}
function playInfectedSurface() {
this.mcSurface.gotoAndPlay("start");
}
function playBkgd() {
this.mcBKGD.gotoAndPlay("start");
}
//add event to check for stop buttons being clicked
this.btnStopCough.addEventListener("click", stopCough.bind(this));
this.btnStopHandshake.addEventListener("click", stopHandshake.bind(this));
this.btnStopInfectedSurface.addEventListener("click", stopInfectedSurface.bind(this));
this.btnStopBkgd.addEventListener("click", stopBkgd.bind(this));
//functions to stop animations
function stopCough() {
this.mcCough.stop();
}
function stopHandshake() {
this.mcHandshake.stop();
}
function stopInfectedSurface() {
this.mcSurface.stop();
}
function stopBkgd() {
this.mcBKGD.stop();
}
all the buttons and Movie clips are correct and I have the gotoandplay and what not on all the movie clips I'm using but I don't know whats wrong.
Depending on the browser, the error console may not list errors that occurred before the console was opened. So open the console, refresh the page, then look for errors.
Copy link to clipboard
Copied
open your console and check the error message.
Copy link to clipboard
Copied
Theres no error message
Copy link to clipboard
Copied
attach a screenshot of your console showing there's no error message.
Copy link to clipboard
Copied
Depending on the browser, the error console may not list errors that occurred before the console was opened. So open the console, refresh the page, then look for errors.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now