Function problem

I have created an swf which has a button, and a dynamic text box (i used it instead of trace)

The button has this code

on (press) { 
    data = new LoadVars(); 
    data.onLoad = function(ok) { 
 	  if (ok) { 
 		 _root.fire = data.name; 
 	  } 
    }; 
    data.load("test.txt"); 
    pass = _root.fire; 
 } 

and “pass” is the name of the text box. The problem is that the above code gives “undefined”. If i put “pass = _root.fire;” inside the function it will work, but i want _root.fire to use it in other functions as well.

I f u want, take a look at the fla

fla here