# How to access a variable in one function by another function

**URL:** <https://forum.kirupa.com/t/how-to-access-a-variable-in-one-function-by-another-function/246213>\
**Category:** flash\
**Created:** [December 8, 2007, 2:58am UTC](https://forum.kirupa.com/t/how-to-access-a-variable-in-one-function-by-another-function/246213 "2007-12-08T02:58:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tarunkumar\_redd](https://avatars.discourse-cdn.com/v4/letter/t/f08c70/32.png) [@tarunkumar\_redd](https://forum.kirupa.com/u/tarunkumar_redd)\
**Post date:** [December 8, 2007, 2:58am UTC](https://forum.kirupa.com/t/how-to-access-a-variable-in-one-function-by-another-function/246213/1 "2007-12-08T02:58:54Z")

</div>

Hello,  
i am doing a small application and am a less knowledged fellow in actionscript.

consider

function a() {  
var test = 20;  
}

function b() {  
trace(test);  
}

in the above there is no global variable stuff…I need to acess test in function b…  
Tell me how please!!!
