Copy link to clipboard
Copied
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!
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Context, not scope.
Copy link to clipboard
Copied
Thanks mate.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now