Button press variable & if statement

Some help please. I know it’s something simple, but I can’t get it to work. “this.clicked” shows up as undefined :*(:


function onClick() {
    clicked = true;
}
button1.onPress = onClick;
if (this.clicked) {
    gotoAndStop(2);
}