# Local Variable outside of the function?

**URL:** <https://forum.kirupa.com/t/local-variable-outside-of-the-function/289315>\
**Category:** flash\
**Created:** [May 28, 2009, 9:07pm UTC](https://forum.kirupa.com/t/local-variable-outside-of-the-function/289315 "2009-05-28T21:07:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dimitree](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/dimitree/32/2530_2.png) [@Dimitree](https://forum.kirupa.com/u/Dimitree)\
**Post date:** [May 28, 2009, 9:07pm UTC](https://forum.kirupa.com/t/local-variable-outside-of-the-function/289315/1 "2009-05-28T21:07:39Z")

</div>

Is there any possibility I can “call” a local variable in a new function?  
for ex.

```auto

function createMainText():void{
       var dynText:TextField = new TextField();// local var
        stage.addChild(dynText);
	dynText.y=stage.stageHeight-80;	

}              
  stage.addEventListener(Event.RESIZE, resiz);

function resiz(event:Event):void 
// How can I "pass" this variable to the resiz function?
{ Tweener.addTween(dynText, {alpha:1, y:stage.stageHeight-80, time:0.3, transition:"easeIn"});
     } 

```
