Passing Variables help

This is probably a very easy thing, but i am stumped. How do you set a variable so that other layers can retrieve that variable. here is my code :


nick.onPress = function ()
{
    set.my_txt = "nick";
    gotoAndPlay(2);
    trace(get.my_txt);  // This does return "nick"
};

//  Then in another layer after the animation :

trace(get.my_txt);  // this returns undefined
maintextarea.text = get.my_txt + "'s Portfolio";

Thanks in advance!