-
loadvars doesn't work online?
I've got a simple text file which I want to read with LoadVars:
Code:
&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.
Code:
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? All I've got is this one frame with code and a dynamic textfield.
See attached files. The published files .html .txt and .swf are all in the same location.
-
Found out that it had something to do with the test webhost I was using (http://www.**********.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?
-
Read a similar topic on the http://www.**********.com forum:
http://www.**********.com/forum/cust...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?
-
Registered User
hi,
If the problem is the file extension, just change it to an extension that the host supports.
For example, instead of test.txt, you can try test.html.
As long as you can view the file in the browser, you should be good to go.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|