Skip to main content
CodeDeveloperOM
Inspiring
August 8, 2021
Question

Uncaught TypeError: this.gotoAndStop is not a function??

  • August 8, 2021
  • 1 reply
  • 743 views

function total_S() { if (this.total = 1) { this.gotoAndStop(3); } }

 

Uncaught TypeError: this.gotoAndStop is not a function???

 

 

    This topic has been closed for replies.

    1 reply

    kglad
    Community Expert
    Community Expert
    August 9, 2021

    this is probably undefined, or at least, does not reference a movieclip.  ie, what's calling total_S()?

    CodeDeveloperOM
    Inspiring
    August 10, 2021

     

    this.home_2.on("click", function () {
    this.gotoAndStop(0);
    this.total++;
    }, this);

    CodeDeveloperOM
    Inspiring
    August 10, 2021

    The problem has been resolved

    var that = this;

    this.home_2.on("click", function () {
    that.gotoAndStop(0);
    total++;
    }, this);