# Easy variable scope problem

**URL:** https://forum.kirupa.com/t/easy-variable-scope-problem/205075
**Category:** Uncategorized
**Created:** [October 25, 2006, 10:14pm UTC](https://forum.kirupa.com/t/easy-variable-scope-problem/205075 "2006-10-25T22:14:27Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![kalexand](https://avatars.discourse-cdn.com/v4/letter/k/67e7ee/32.png) [@kalexand](https://forum.kirupa.com/u/kalexand)
#### Post date: [October 25, 2006, 10:14pm UTC](https://forum.kirupa.com/t/easy-variable-scope-problem/205075/1 "2006-10-25T22:14:27Z")

</div>

i’m using a slide presentation document, and i have this code attached onto a slide:

on (load) {  
var tmp = 5;  
}  
on (reveal) {  
trace(tmp);  
}

but when i run it, it traces ‘undefined’…  
what am i missing here?
