If statement help

I need an if statement to act based on the button pressed

if (BUTTONPRESSED == BUTTONNAME) {
gotoandplay(“label1”)
gotoandplay(“label2”)
gotoandplay(“label3”)

}

please help me format the syntax for this? i dont know how to do it so that
it acts based on the button instance.

also…i dont know how to have it play a certain number of frames,
before skipping to the next gotoandplay from the if statement.

please help!
thank you thank you!