# LoadVars on the server is not working

**URL:** <https://forum.kirupa.com/t/loadvars-on-the-server-is-not-working/8327>\
**Category:** flash\
**Created:** [November 18, 2002, 7:10pm UTC](https://forum.kirupa.com/t/loadvars-on-the-server-is-not-working/8327 "2002-11-18T19:10:28Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Spongebob](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@Spongebob](https://forum.kirupa.com/u/Spongebob)\
**Post date:** [November 18, 2002, 7:10pm UTC](https://forum.kirupa.com/t/loadvars-on-the-server-is-not-working/8327/1 "2002-11-18T19:10:28Z")

</div>

Hi there,  
I’m using the LoadVars object to read data from a textfile. Everything works fine when I play my movie locally or on another computer in the network, but when I play it on the server, it does not load any data at all ☹

```
  I've already read about this (http://www.kirupaforum.com/showthread.php?s=&threadid=8661), but still couldn't make my movie work on the server... :-\ 

This is the code I'm using...

// --------------------------------------------
stop();
var _lvit = new LoadVars();
_lvit.onLoad = [COLOR=blue]onDataLoaded_Language[/COLOR];
// --------------------------------------------
[COLOR=blue]function onDataLoaded_Language()[/COLOR]{
	gotoAndPlay(_currentframe + 1);
}
// --------------------------------------------
// Loading language text file...
load_url = "data/ladata.txt";
[COLOR=orange]_lvit.load(load_url);[/COLOR]
// --------------------------------------------

In a later frame I use the textfile's variables loaded in the _lvit object. They should be loaded cause I've used a function to check this, am I right ? 

I.E.:	
[COLOR=crimson]_root.BTN_Map.Txt_Map.text = _root._lvit.t_pmap;[/COLOR] 

But no text is seen on the button unless I hardcode it... And, no trace(variable) is executed either...

Do you have any suggestions for my movie to play correctly on the server ?

Thanks in advance,
	Spongebob.
```

---

<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:** [November 18, 2002, 7:22pm UTC](https://forum.kirupa.com/t/loadvars-on-the-server-is-not-working/8327/2 "2002-11-18T19:22:34Z")

</div>

Hmm, where did u assign the textfile?

---

<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:** [November 18, 2002, 7:29pm UTC](https://forum.kirupa.com/t/loadvars-on-the-server-is-not-working/8327/3 "2002-11-18T19:29:58Z")

</div>

Right here:

// Loading language text file…  
load\_url = "[COLOR=red]data/ladata.txt[/COLOR] ";  
\_lvit.load(load\_url);

Is it wrong if I do like that ? :\*(

Thanks!  
Spongebob

---

<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:** [November 18, 2002, 7:31pm UTC](https://forum.kirupa.com/t/loadvars-on-the-server-is-not-working/8327/4 "2002-11-18T19:31:15Z")

</div>

Hmm, sorry, i mean which var is being assigned to the Dynamic text field, i just want to to tell u to assign it onLoad, so it would solve the timing in yar server!!

---

<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:** [November 18, 2002, 7:39pm UTC](https://forum.kirupa.com/t/loadvars-on-the-server-is-not-working/8327/5 "2002-11-18T19:39:12Z")

</div>

I’m assigning a var called t\_pmap from the textfile to the dynamic text…

Is that what you’re asking me ? My english is not very good and sometimes I just don’t get it, sorry ☹

root.BTN\_Map.Txt\_Map.text = [COLOR=seagreen]\_root.\_lvit.t\_pmap[/COLOR];

How do I assign it onLoad ?

Thanks,  
Spongebob

---

<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:** [November 18, 2002, 7:42pm UTC](https://forum.kirupa.com/t/loadvars-on-the-server-is-not-working/8327/6 "2002-11-18T19:42:08Z")

</div>

On yar function:

```php
function onDataLoaded_Language(){
_root.BTN_Map.Txt_Map.text = _root._lvit.t_pmap; 
gotoAndPlay(_currentframe + 1);
}

```

Test it, and come back tell us how it goes!

---

<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:** [November 18, 2002, 8:35pm UTC](https://forum.kirupa.com/t/loadvars-on-the-server-is-not-working/8327/7 "2002-11-18T20:35:29Z")

</div>

Hi h88,  
Tested it but it didn’t work out ☹

What I don’t understand is why all of my code works fine offline and it doesn’t work online :\*( Shouldn’t it be the same ?

Are there any other things I can try ?

Lots of thanks,  
Spongebob.

---

<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:** [November 18, 2002, 8:38pm UTC](https://forum.kirupa.com/t/loadvars-on-the-server-is-not-working/8327/8 "2002-11-18T20:38:55Z")

</div>

Hmm, thats really odd, “onLoad” should assign the var in ur txtfile when its loaded! can i have a look at ur fla?

---

<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:** [November 18, 2002, 9:01pm UTC](https://forum.kirupa.com/t/loadvars-on-the-server-is-not-working/8327/9 "2002-11-18T21:01:27Z")

</div>

Sure !! 🙂 I made a small example which still works offline only…  
Here is the attached file…

I’ve just put it on the server and nothing displays on the button ☹

Thanks!  
Spongebob.

---

<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:** [November 18, 2002, 10:00pm UTC](https://forum.kirupa.com/t/loadvars-on-the-server-is-not-working/8327/10 "2002-11-18T22:00:33Z")

</div>

Ok, everything is solved now, check the attached ZIP, and tell me how it goes:

1- The first problem was that u didnt define onLoad properly.

2- Don’t ever name folders like this “DATA” while on ur swf its “data”, when its offline, there is no case-sensitivity problem, but in your website, there is.

Anyways, tell me how it goes.

yours,  
h88

---

<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:** [November 19, 2002, 1:36pm UTC](https://forum.kirupa.com/t/loadvars-on-the-server-is-not-working/8327/11 "2002-11-19T13:36:53Z")

</div>

Yeeees !! you did it! :rambo:  
It worked perfectly!! I’m soooo glad! =)

Millions of thanks to you h88 !!  
Spongebob

---

<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:** [November 19, 2002, 5:28pm UTC](https://forum.kirupa.com/t/loadvars-on-the-server-is-not-working/8327/12 "2002-11-19T17:28:11Z")

</div>

No problem. 🙂
