Forum Moderators: not2easy
Comparing a variable received this way, doesn't work. E.g. logged_on is the name of a loadVars variable which receives a value through loadvars.
A statement like : if (loadVars1.logged_on == "yes") does not evaluate to true. Elsewhere in the code for this movie, same frame, another variable is set: show = loadvars.logged_on. This correctly displays the word "yes". Is there some form of coding/decoding of the strings received through loadVars that must be done first, in order to get the if statement to test loadVars1.logged_on correctly?
I'm having this problem in more than one place. So it seems that the loadVars1.logged_on contains a string which is not only "yes" but has some form of encoding as well. I've tried unescape, but that's for all the other kind of characters anyway, and it has no effect on the value "yes".
Another thought is are you sure that loadVars1.logged_on has recieved the variable by the time you want it read?
ie.
loadVars1.sendAndLoad(...
loadVars1.onLoad() = function(){
if(loadVars1.logged_on=="yes"){
...
}
}
Not sure if this will help since you seem to be able to read the value sometimes, but not all the time. Perhaps try tracing the value before you want it called to be sure it's in the correct value ranges ie. "yes"¦¦"no".
Regards,
winstun
Yes, I am doing the "onLoad" bit to make sure the variable has loaded (as in your code below). Also, in the "onLoad" function, the value received is assigned to another dynamic text variable, where it shows up, so I can see for definite that it has loaded.
"loadVars1.sendAndLoad(...
loadVars1.onLoad() = function(){
if(loadVars1.logged_on=="yes"){
...
}
} "
I'm going to try trim() in PHP; however, as it is at the moment, the variable is assigned in PHP as $result = "yes"; It then becomes part of a string to be returned: returnstring = "value1=hello&value2=byebye&value3=".$result."";
echo $returnstring;
I remember having an empty string after result as you see above. Am going to check that out, maybe that's causing the problem.
Thanks, will report back
mlkarie