Skip to main content
Participating Frequently
April 16, 2020
Answered

Clip containing 3 buttons.

  • April 16, 2020
  • 1 reply
  • 456 views

Hello people.
I have a Movie Clip containing 3 buttons.
One of the 3 buttons has the right answer to a given question.
the buttons have the following occurrence names:
Button 1: sul_01_opcao_1
Button 2: sul_01_opcao_2
Button 3: sul_01_opcao_3
And the Movie Clip has the occurrence name: sul_pergunta_01
The problem that is occurring is that all buttons are going to the same frame when pressed.
My code looks like this:

this.sul_pergunta_01.sul_01_opcao_1.addEventListener("click", fl_ClickToGoToAndPlayFromFrame.bind(this));

function fl_ClickToGoToAndPlayFromFrame()
{
	this.gotoAndPlay(5);
}

this.opcao_2.addEventListener("click", fl_ClickToGoToAndPlayFromFrame.bind(this));

function fl_ClickToGoToAndPlayFromFrame()
{
	this.gotoAndPlay(11);
}

this.opcao_3.addEventListener("click", fl_ClickToGoToAndPlayFromFrame.bind(this));

function fl_ClickToGoToAndPlayFromFrame()
{
	this.gotoAndPlay(5);
}
    This topic has been closed for replies.
    Correct answer JoãoCésar17023019

    Hi.

     

    It's because you gave the same name to all functions: fl_ClickToGoToAndPlayFromFrame.

     

    Choose a different name for each one.

     

     

    Regards,

    JC

    1 reply

    JoãoCésar17023019
    Community Expert
    JoãoCésar17023019Community ExpertCorrect answer
    Community Expert
    April 16, 2020

    Hi.

     

    It's because you gave the same name to all functions: fl_ClickToGoToAndPlayFromFrame.

     

    Choose a different name for each one.

     

     

    Regards,

    JC

    Participating Frequently
    April 16, 2020

    Wow! I still have a lot to learn.

    Thanks again!