Loading SWF, paths get messed up...help!

Hi all!

I have my main flash file that plays from the root dir. In that main file I use the loadmove to load " 1/1.swf"

the new file inside of folder 1 (1.swf) loads vars from two folders "data and images.

When I go to test everything, I lose the paths for my file 1.swf. Its looking to load “root/data/data.txt” from the root dir, not from the 1 folder. It should look for “root/1/data/data.txt”

Thanks in advanced…really need help on this one.

HERE IS MY CODE:
This is the code that loads 1.swf .It is in a blank MC located on the main timeline. Its file location is:
root/main.swf

this.loadMovie(“1/1.swf”);

This is the code inside 1.swf that loads its data and images, its file location is:
root/1/1.swf

lvObj = new LoadVars();
lvObj.load(“data/data.txt”);
lvObj.onLoad = function(ok)
{
if(ok)
{
myColor = new Color(mc_colorp); // _mc is the instance name of the movieclip
myColor.setRGB(lvObj.colorp);

myColorS = new Color(mc_colors); // _mc is the instance name of the movieclip
myColorS.setRGB(lvObj.colors);

}
}

lvObj = new LoadVars();
lvObj.load(“data/data.txt”);
lvObj.onLoad = function(ok)

its looking for data/data.txt because that is what your specifying.

try using the full path to the file.

sam

Thanks sam for your reply. The problem is, that the full path is dynamic…it would be:

1/data/data.txt or 3/data/data.txt or 4/data/data.txt.

they are template files that get put in folders…thats why I am using the relative path.

Any help?