A "gotoAndPlay() question

Can’t I use gotoAndPlay() with a variable?
Ex:
framenum = 15 ;
.
.
.
gotoAndPlay(framenum);

does this work?

I tried but someway it doesn’t work… Is there a way that I can use gotoandplay like this?

thanks for replies