Fancy changable destination goto action

I have been told that i can use something like

on (release) {
gotoAndPlay(“two”, 1);
destination = profile;
}

and then when it gets there.

gotoAndPlay(“destination”);

So it should bascially mean
gotoAndPlay(“profile”); when it gets there. Ive been fiddling and i cant get it to work. Am I doing something wrong? Or was it a lie? Thanks in advance.