HELP! using a variable from a function

Hi,

Probably a simple question but I’m new to this.

I’m retrivning a value from a textfile. The value is a path to a folder containg images. The value retrieved from thePics variable is images/test/

Now my problem, I want the variable test to contain the value from thePics variable. My problem is that the test variable is only accessible inside the function (see comment)

myLoadVars.onLoad = function(success){
if (success){
this.test = myLoadVars.thePics; //
trace(this.test); //correct value here
}else{
trace(“no variables loaded”);
}
};

//Here is where I want my test variable with the path “images/test/”
this.pathToPics = (test);

The path is the path to the folder, when correct the firstFile.jpg shoud be displayed. If I declare the test variable with:

test = (“images/dragar2/”); everyting is working fine, but not when I retrive it from the textfile inside the function.

Thanks