# Undefined variable

**URL:** <https://forum.kirupa.com/t/undefined-variable/105650>\
**Category:** Uncategorized\
**Created:** [March 28, 2004, 4:57pm UTC](https://forum.kirupa.com/t/undefined-variable/105650 "2004-03-28T16:57:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bmerens](https://avatars.discourse-cdn.com/v4/letter/b/43a26b/32.png) [@bmerens](https://forum.kirupa.com/u/bmerens)\
**Post date:** [March 28, 2004, 4:57pm UTC](https://forum.kirupa.com/t/undefined-variable/105650/1 "2004-03-28T16:57:45Z")

</div>

on level 0 : I have variable1=23;

by clicking on a button : loadmovie test.swf on level 1

once the test.swf loaded :

on level 1 another button with AS :

dir=level0:variable1

on (release) {  
\_level0.gotoAndStop(dir); // but this button don’t work  
}

the error is in the AS of this button.

by typing the AS : \_level0.gotoAndStop(23); everything is ok. The AS works.

So I made a trace(typeof(dir)) and the result is : undefined

who can I get this button to work ? do I have to transform the variable dir to a number ???

is there another possibility?

thanks for your help
