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

Targeting main stage for navigation 'scope'

Participant ,
Sep 20, 2018 Sep 20, 2018

Hi there,

I'm getting an error when it comes to using this.gotoAndPlay('end'). I have a label with 'end' so that I don't need to use frame numbers

Essentially, I have a few drag functions. The function 'finish();' fires at the 'mouseup' per drag (so right at the end).

Finish function looks like this:

function finish(){
     score++;
     console.log(score);

     if(score == 3){

          this.gotoAndPlay('end');

}
}

The score gets to 3 but then..

I'm getting an error on this.gotoAndPlay('end'). I assume it's because of the 'scope'..

Any help is greatly appreciated!

281
Translate
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

Participant , Sep 20, 2018 Sep 20, 2018

I solved this myself. The 'scope' was wrong.

var root = this; at the start of the program and then root.gotoAndPlay('end'); works very well.

Translate
Participant ,
Sep 20, 2018 Sep 20, 2018

I solved this myself. The 'scope' was wrong.

var root = this; at the start of the program and then root.gotoAndPlay('end'); works very well.

Translate
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
LEGEND ,
Sep 21, 2018 Sep 21, 2018
Translate
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
Participant ,
Sep 23, 2018 Sep 23, 2018
LATEST

Thanks mate.

Translate
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