# Passing Variables help

**URL:** <https://forum.kirupa.com/t/passing-variables-help/200094>\
**Category:** flash\
**Created:** [September 8, 2006, 4:08pm UTC](https://forum.kirupa.com/t/passing-variables-help/200094 "2006-09-08T16:08:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![atokatim](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@atokatim](https://forum.kirupa.com/u/atokatim)\
**Post date:** [September 8, 2006, 4:08pm UTC](https://forum.kirupa.com/t/passing-variables-help/200094/1 "2006-09-08T16:08:16Z")

</div>

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 :

```php

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!
