# Getting variables value from inside function

**URL:** <https://forum.kirupa.com/t/getting-variables-value-from-inside-function/31289>\
**Category:** flash\
**Created:** [September 20, 2003, 9:09pm UTC](https://forum.kirupa.com/t/getting-variables-value-from-inside-function/31289 "2003-09-20T21:09:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nocturn](https://avatars.discourse-cdn.com/v4/letter/n/90ced4/32.png) [@Nocturn](https://forum.kirupa.com/u/Nocturn)\
**Post date:** [September 20, 2003, 9:09pm UTC](https://forum.kirupa.com/t/getting-variables-value-from-inside-function/31289/1 "2003-09-20T21:09:00Z")

</div>

I’m pretty new to AS, I understand that whatever variables you have inside a function will be discarded once the function finishes?

I need the value of a variable that’s inside a function, I’ve tried declaring it outside the function, and also give it an initial value, but it seems that when the function finishes the variable goes back to it’s original value.
