Highlighted

Animate buttons not taking me to certain frames

New Here ,
May 01, 2019

Copy link to clipboard

Copied

I'm having a problem with some buttons on animate. The HTML is correct and the button has an instance name. I can go to the next frame or the frame after if I change the code but not the frame I need to go to. The rest of the buttons work perfectly, this is the only problematic one. The output mentions content using bitmap and buttons may cause errors but I've moved all of the buttons from these frames to new frames so I don't think it's that. Any ideas? Screen Shot 2019-05-01 at 12.47.17.pngScreen Shot 2019-05-01 at 12.47.39.png

Adobe Community Professional
Correct answer by JoãoCésar | Adobe Community Professional

Hi.

You have three functions with the same name in the first image. Give them different names.

Regards,

JC

TOPICS
Discussions

Views

120

Likes

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

Animate buttons not taking me to certain frames

New Here ,
May 01, 2019

Copy link to clipboard

Copied

I'm having a problem with some buttons on animate. The HTML is correct and the button has an instance name. I can go to the next frame or the frame after if I change the code but not the frame I need to go to. The rest of the buttons work perfectly, this is the only problematic one. The output mentions content using bitmap and buttons may cause errors but I've moved all of the buttons from these frames to new frames so I don't think it's that. Any ideas? Screen Shot 2019-05-01 at 12.47.17.pngScreen Shot 2019-05-01 at 12.47.39.png

Adobe Community Professional
Correct answer by JoãoCésar | Adobe Community Professional

Hi.

You have three functions with the same name in the first image. Give them different names.

Regards,

JC

TOPICS
Discussions

Views

121

Likes

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
May 01, 2019 0
Adobe Community Professional ,
May 01, 2019

Copy link to clipboard

Copied

Hi.

You have three functions with the same name in the first image. Give them different names.

Regards,

JC

__________________________________________
HTML5, JSFL, and AS3 samples: http://bit.ly/2mJgDoG

Likes

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
Reply
Loading...
May 01, 2019 0
New Here ,
May 01, 2019

Copy link to clipboard

Copied

Okay, perfect, thank you! I need to ask though, what do I actually need to change? I'm a complete novice   . The this. lines of code?

Likes

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
Reply
Loading...
May 01, 2019 0
Adobe Community Professional ,
May 01, 2019

Copy link to clipboard

Copied

It seems you first image disappeared.

Anyway, following your approach, a practical and safe way would be like this:

function gotoFrame0(e)

{

     this.gotoAndStop(0);

}

function gotoFrame1(e)

{

     this.gotoAndStop(1);

}

function gotoFrame2(e)

{

     this.gotoAndStop(2);

}

if (!this.frame0Started) // this check is to prevent the buttons from receiving multiple listeners

{

     this.stop();

     this.button0.addEventListener("click", gotoFrame0.bind(this));

     this.button1.addEventListener("click", gotoFrame1.bind(this));

     this.button2.addEventListener("click", gotoFrame2.bind(this));

     this.frame0Started = true;

}

Each button gets a different handler function.

Regards,

JC

__________________________________________
HTML5, JSFL, and AS3 samples: http://bit.ly/2mJgDoG

Likes

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
Reply
Loading...
May 01, 2019 2
Engaged ,
May 01, 2019

Copy link to clipboard

Copied

Ha ha! The missing first image now explains a lot!

I thought "I know João is really good... but I didn't know he was THIS good!!!" as I couldn't see the 3 functions in the first (now gone) image!!!

Likes

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
Reply
Loading...
May 01, 2019 3
Adobe Community Professional ,
May 01, 2019

Copy link to clipboard

Copied

HAHAHAHAHAHA!

And I wish I was THIS good!

__________________________________________
HTML5, JSFL, and AS3 samples: http://bit.ly/2mJgDoG

Likes

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
Reply
Loading...
May 01, 2019 1