# Local variable "this"

**URL:** <https://forum.kirupa.com/t/local-variable-this/320484>\
**Category:** flash\
**Created:** [March 24, 2011, 5:33pm UTC](https://forum.kirupa.com/t/local-variable-this/320484 "2011-03-24T17:33:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![atrum](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@atrum](https://forum.kirupa.com/u/atrum)\
**Post date:** [March 24, 2011, 5:33pm UTC](https://forum.kirupa.com/t/local-variable-this/320484/1 "2011-03-24T17:33:09Z")

</div>

So basic as3 evaluation…

```auto
var r = 0;
trace( this["r"] );
//output: 0

```

but how about…

```auto
var r = 0;
function foo(){
  var r = 3;
  trace( this["r"] );
}
foo();
//output: 0

```

how do you access a local variable via evaluating a string? (in other words, the output would be 3, stored in the local variable, not 0)
