Hi,
Recently i have been workin on a flash/asp login. I've used loadVars() to send
username and password from the flash movie to an asp file where the value's are
validated. After validating the posted values a text file (varsToFlash.txt) is
created where the results are stored like this for example
when username is wrong >> UN=username incorrect&PW=,
when password is wrong >> UN=&PW=password incorrect"
when both are correct >> UN=username correct&PW=password correct
these values i retrieve within the flash movie again with loadVars() and
display the results in a dynamic textfield named mssgVar.
Everything works fine when i log in the first time (for ex. if i post a
wrong username the textfield shows "Wrong username".
But then when i login for the second or third time with a wrong password or a
correct username and correct password the same error is shown in the textfield
namely WRONG USERNAME. Its seems the flash movie holds on to the value passed
by the first attempt to login, however when i open the textfile
(varsToFlash.txt) the correct values a written there. Is this a cache problem??
Below the code which retrieves the values from the textfile (varsToFlash.txt)
Does someone knows the answer to this problem?
Thanks
David
System.useCodepage=true;
mssgVar.html=true;
myLoadVar = new LoadVars ();
myLoadVar.load("flash/loadvars/varsToFlash.txt");
//check to see if the loading is completed and, if so, put the contents in the
text field
myLoadVar.onLoad = function (success){
if (success == true) {
mssgVar = myLoadVar.mssgVar;
return;
}else{
mssgVar = "Error loading content."
}
}
stop();
Motion Maker - 29 Apr 2006 20:40 GMT
1. mssgVar = myLoadVar.mssgVar;
should be
mssgVar.htmlText = myLoadVar.mssgVar;
2. mssgVar = "Error loading content."
should be
mssgVar.htmlText = "Error loading content."
3. Also you are open to timing bugs because the onLoad handler is assigned
its function after the load method. It is possible the load would complete
before the onLoad assignment line is reached. Remote the possiblity is, it
is not a good practice.
4. You should be using sendAndLoad if you are send values from Flash to the
server and expecting a result.
http://livedocs.macromedia.com/flash/8/main/00002336.html

Signature
Lon Hosford
www.lonhosford.com
May many happy bits flow your way!
Hi,
Recently i have been workin on a flash/asp login. I've used loadVars() to
send
username and password from the flash movie to an asp file where the value's
are
validated. After validating the posted values a text file (varsToFlash.txt)
is
created where the results are stored like this for example
when username is wrong >> UN=username incorrect&PW=,
when password is wrong >> UN=&PW=password incorrect"
when both are correct >> UN=username correct&PW=password correct
these values i retrieve within the flash movie again with loadVars() and
display the results in a dynamic textfield named mssgVar.
Everything works fine when i log in the first time (for ex. if i post a
wrong username the textfield shows "Wrong username".
But then when i login for the second or third time with a wrong password or
a
correct username and correct password the same error is shown in the
textfield
namely WRONG USERNAME. Its seems the flash movie holds on to the value
passed
by the first attempt to login, however when i open the textfile
(varsToFlash.txt) the correct values a written there. Is this a cache
problem??
Below the code which retrieves the values from the textfile
(varsToFlash.txt)
Does someone knows the answer to this problem?
Thanks
David
System.useCodepage=true;
mssgVar.html=true;
myLoadVar = new LoadVars ();
myLoadVar.load("flash/loadvars/varsToFlash.txt");
//check to see if the loading is completed and, if so, put the contents in
the
text field
myLoadVar.onLoad = function (success){
if (success == true) {
mssgVar = myLoadVar.mssgVar;
return;
}else{
mssgVar = "Error loading content."
}
}
stop();