-
i have a problem wid checking a variable inside a text files.
Code:
on (release) {
myVars = new LoadVars();
myVars.load("nb_chk.txt");
myVar.onLoad = function(success) {
if (success) {
if (nb_checker == "1") {
gotoAndStop("notice board");
}
}
};
}
basically wha i want it to do is load a text files ( nb_chk.txt ) and inside the text file it has a variable called ( nb_checker ) inside the text file it has ( nb_checker=1 ) and what i want my script above to do is check to see ( nb_checker=1 ( this is inside ma text file ) ) equals to whats i got (nb_checker == "1" ( this is inside my swf file ) ) . I have also made sure that alll the variables and the text file r correct and i also made sure the file is in the right location... nothing is happening . anyone know why it's not performing this???
-
have u checked the debugger and see if nb_checker = "1"?
If it is confirmed = 1 then add _root. to your gotoAndStop("notice board") which is _root.gotoAndStop("notice board").
-
Could be a typo here, but make sure your third line is myVars... And add the bold line!
myVars = new LoadVars();
myVars.load("checker.txt");
myVars.onLoad = function(success) {
if (success) {
nb_checker = this.nb_checker;
if (nb_checker == 1) {
//trace (nb_checker);
_root.gotoAndStop("notice board");
}
}
};
-
Originally posted by oldnewbie
Could be a typo here, but make sure your third line is myVars... And add the bold line!
myVars = new LoadVars();
myVars.load("checker.txt");
myVars.onLoad = function(success) {
if (success) {
nb_checker = this.nb_checker;
if (nb_checker == 1) {
//trace (nb_checker);
_root.gotoAndStop("notice board");
}
}
};
thx's man!!! it works wonder!
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
|