• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Hi, Everybody I need Your Help! Urgent

Community Beginner ,
Dec 29, 2019 Dec 29, 2019

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

TOPICS
Code , Error , How to , Other , Timeline

Views

466

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Dec 30, 2019 Dec 30, 2019

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

...

Votes

Translate

Translate
Explorer ,
Dec 30, 2019 Dec 30, 2019

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!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 30, 2019 Dec 30, 2019

Copy link to clipboard

Copied

LATEST

Thank you for your respond sir, im really helpfull. Thank you...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines