Skip to main content
Inspiring
July 13, 2010
Question

loadvars doesn't work online?

  • July 13, 2010
  • 1 reply
  • 605 views

I've got a simple text file with a variable in it:

&tekst=This is a test&

I'm loading it with LoadVars and let the text of one dynamic textfield be replaced by the 'tekst' variable.

stop();

var my_lv:LoadVars = new LoadVars();

my_lv.onLoad = function(success:Boolean) {

if (success) {

tekst_txt.text = my_lv.tekst;

} else {

trace("Error loading/parsing LoadVars.");

}

};

my_lv.load("test.txt");

This works offline, but online the text isn't replaced? This should work right? So what's wrong?

The code and the dynamic textfield are both on frame 1. The swf only has this one frame. The txt, swf and html file are at the same location.

This topic has been closed for replies.

1 reply

jiggy1965Author
Inspiring
July 13, 2010

Found out that it had something to do with the test webhost I was using which I used to test my files (http://www.000webhost.com/). When I put it on my own host server it works just fine and the textfield is filled with the variable.

How's that possible. Can some setup on a hosting provider prevend LoadVars to work correctly?

jiggy1965Author
Inspiring
July 13, 2010

Read a similar topic on the http://www.000webhost.com forum:

http://www.000webhost.com/forum/customer-assistance/14178-help-flash-as2-path-000-pages.html

Read post 2: "txt files are blocked for security reasons"?

So that's why it wasn't working, though I'm unsure why txt files could be a security risk?