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

**URL:** <https://forum.kirupa.com/t/loading-swf-paths-get-messed-up-help/111439>\
**Category:** Uncategorized\
**Created:** [May 26, 2004, 10:06pm UTC](https://forum.kirupa.com/t/loading-swf-paths-get-messed-up-help/111439 "2004-05-26T22:06:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaslgv](https://avatars.discourse-cdn.com/v4/letter/j/c77e96/32.png) [@jaslgv](https://forum.kirupa.com/u/jaslgv)\
**Post date:** [May 26, 2004, 10:06pm UTC](https://forum.kirupa.com/t/loading-swf-paths-get-messed-up-help/111439/1 "2004-05-26T22:06:16Z")

</div>

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);

}  
}

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 26, 2004, 10:30pm UTC](https://forum.kirupa.com/t/loading-swf-paths-get-messed-up-help/111439/2 "2004-05-26T22:30:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 26, 2004, 11:01pm UTC](https://forum.kirupa.com/t/loading-swf-paths-get-messed-up-help/111439/3 "2004-05-26T23:01:34Z")

</div>

> [@maximum\_flash](#):
>
> 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?
