PDA

View Full Version : LoadVars on the server is not working



Spongebob
November 18th, 2002, 02:10 PM
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 = onDataLoaded_Language;
// --------------------------------------------
function onDataLoaded_Language(){
gotoAndPlay(_currentframe + 1);
}
// --------------------------------------------
// Loading language text file...
load_url = "data/ladata.txt";
_lvit.load(load_url);
// --------------------------------------------

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.:
_root.BTN_Map.Txt_Map.text = _root._lvit.t_pmap;

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.

h88
November 18th, 2002, 02:22 PM
Hmm, where did u assign the textfile?

Spongebob
November 18th, 2002, 02:29 PM
Right here:

// Loading language text file...
load_url = "data/ladata.txt ";
_lvit.load(load_url);

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

Thanks!
Spongebob

h88
November 18th, 2002, 02:31 PM
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!!

Spongebob
November 18th, 2002, 02:39 PM
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 = _root._lvit.t_pmap;

How do I assign it onLoad ?

Thanks,
Spongebob

h88
November 18th, 2002, 02:42 PM
On yar function:


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!

Spongebob
November 18th, 2002, 03:35 PM
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.

h88
November 18th, 2002, 03:38 PM
Hmm, thats really odd, "onLoad" should assign the var in ur txtfile when its loaded! can i have a look at ur fla?

Spongebob
November 18th, 2002, 04:01 PM
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.

h88
November 18th, 2002, 05:00 PM
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

Spongebob
November 19th, 2002, 08:36 AM
Yeeees !! you did it! :rambo:
It worked perfectly!! I'm soooo glad! =)

Millions of thanks to you h88 !!
Spongebob

h88
November 19th, 2002, 12:28 PM
No problem. :)