Copy link to clipboard
Copied
Hi, I've new at animate but im confused here, my button works perfect at start but when im back to the previous frame my button doesnt work perfectly.
here i attach my fla file :
https://drive.google.com/file/d/17TYf9mE6rMqvFHwe7APYuCUFpCrazVDm/view?usp=sharing
Pls I need ur help
Hi there!
All the buttons appear to have the same function names of fl_mouseClickHandler. Clicking Animals, Color or Back throws me in different directions they ought not to be.
this.AnimalsBtn1Click.addEventListener("click", fl_MouseClickHandler.bind(this));
function fl_MouseClickHandler() {
this.gotoAndPlay(273);
}
For the above button code, you could change it to say fl_MouseClickHandlerAnimals or even choose a shorter name like fl_Animals. Whatever is easiest for your reference. Below are the
...Copy link to clipboard
Copied
Hi there!
All the buttons appear to have the same function names of fl_mouseClickHandler. Clicking Animals, Color or Back throws me in different directions they ought not to be.
this.AnimalsBtn1Click.addEventListener("click", fl_MouseClickHandler.bind(this));
function fl_MouseClickHandler() {
this.gotoAndPlay(273);
}
For the above button code, you could change it to say fl_MouseClickHandlerAnimals or even choose a shorter name like fl_Animals. Whatever is easiest for your reference. Below are the reflected changes for Animals and Color, which you could then apply to your other menu's buttons:
this.AnimalsBtn1Click.addEventListener("click", fl_Animals.bind(this));
function fl_Animals() {
this.gotoAndPlay(273);
}
this.ColorBtn1Click.addEventListener("click", fl_Color.bind(this));
function fl_Color() {
this.gotoAndPlay(442);
}
As for the back buttons, you can do gotoAndStop(272); because gotoAndPlay(272); starts playing into Animals section. You will also see the new handles changed to fl_Back1 and fl_Back2.
this.stop();
this.BackBtn1Click.addEventListener("click", fl_Back1.bind(this));
function fl_Back1() {
this.gotoAndStop(272);
}
this.stop();
this.BackBtn2Click.addEventListener("click", fl_Back2.bind(this));
function fl_Back2() {
this.gotoAndStop(272);
}
Just tested it all and it works fine for me. Hope that helps!
Copy link to clipboard
Copied
Thank you for your respond sir, im really helpfull. Thank you...