eilsoe
1
Hi all!
This loadvariables thing just refure to work!! 
I have abutton with the following code in it:
on(release){
_root.loadVariables("text.txt","GET");
if(urlcheck!="http://www.avalon-rev.dk"){
_root.textbox.text="file not found - error";
}else{
_root.textbox.text=urlcheck;
}
}
and in the same directory as my movie, I have a txt file with this in it:
urlcheck=http://www.avalon-rev.dk
Problem is, When I click the button, it gives me a “file not found” and “undefined”… 
I followed directions in a book, but it refuses to work!
Can anyone lead me to success?
system
3
for starters (Im in a terrible rush) the line
if(urlcheck= should be
if(urlcheck==
otherwise it will never work.
system
4
montoya: he’s using a “!=” not equal. Its not just an equal sign. Just clarifying.
Eilsoe: you’re using strings…so you have to use string manipulation so to use “not equals” you have to use ‘ne’ for equal you would use ‘eq’
here’s a link in the AS dictionary:
http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary590.html
try this:
if(urlcheck ne 'http://www.avalon-rev.dk'){
//dowhatever here
}else{
//do whatever
}
system
5
Guys guys guys 
You completely missed the point! 
It won’t load the file 
As soon as I try to load the txt file, it gives me an error 
system
6
heheheh
oops 
try doing this:
loadVariables(“text.txt”, “”)
Don’t put anything in the target that way it will load the variables into the root it should work that way.
system
7
A better way to do this is: 
Submit.onRelease = function() {
dataHandler = new LoadVars();
dataHandler.onLoad = function(success) {
if (success) {
if (dataHandler.urlcheck != "http://www.avalon-rev.dk") {
_root.myTextBox.text = "file not found - error";
} else {
_root.myTextBox.text = dataHandler.urlcheck;
}
} else {
myTextBox.text = "Error Loading File...";
}
};
dataHandler.load("text.txt");
};
Put this code in ur _root timeline.
Tell me how it goes,
yours,
h88
system
8
And if u want to use the loadVariables way:
loadVariables("text.txt", _root);
Submit.onRelease = function() {
if (urlcheck != "http://www.avalon-rev.dk") {
_root.myTextBox.text = "file not found - error";
} else {
_root.myTextBox.text = urlcheck;
}
};
Though i recommened LoadVars more, cuz it solves timing problem while loading, loadVariables does’nt. 
system
9
I tried it all now fellas… still doesnt work 
It gives me this: "Error opening URL “file:///C|/test/text.txt”
I put my movie and my txt file in [c: est] directory…
Gawd this is annoying…
system
10
In which one ur intrested eilsoe, i’ll embed an example and attach an fla now!!
system
13
AAAHHH!!!
NOBODY EVER TOLD ME TO PUT AN “&” SIGN IN THE TEXTFILE!!!
That’s what’s wrong!!!
Thx h88 :P:P
works now =)
system
14
All right, no problem dude! 
system
15
roflmao
I think every book I’ve read which detailed that mentions the first & symbol. 
system
16
Well, may be it was a typo in eilsoe’s book.
system
17
Oh well, it worked without an “&”.
system
18
lol… well now that’s completely weird. 