PDA

View Full Version : Code writing question


Lynx75
03-26-2003, 01:57 PM
hi everyone!

ive got a simple frame with two field username and passord.

ive got the "login" button that process if the data insert are correct:

_root.login_btn.onRelease = function () {
if (_root.username.text="lloyds" && _root.password.text="test"){
gotoAndStop ("interface");
}
};

but at the IF line I wish to double check that If the username and password are equal to then we can carry on.My question is: I cant use && operator,which other is ok?

tnx,bye

khamstra
03-26-2003, 02:04 PM
You need double equal signs.
_root.login_btn.onRelease = function () {
if (_root.username.text == "lloyds" && _root.password.text == "test"){
gotoAndStop ("interface");
}
};

khamstra

Lynx75
03-26-2003, 02:22 PM
I get this error..

Scene=webclient, Layer=web client, Frame=1: Line 8: Left side of assignment operator must be variable or property.
if (_root.username.text == "test" && _root.password.text = "test") {


??

senocular
03-26-2003, 02:38 PM
look over that code again carefully ;)

Lynx75
03-26-2003, 03:06 PM
mmm..I dont figure it out...

chewbacca nine
03-26-2003, 03:41 PM
=========== ===========
=========== ===========



=========== ===========
=========== ===========

senocular
03-26-2003, 03:42 PM
Originally posted by Lynx75
I get this error..

Scene=webclient, Layer=web client, Frame=1: Line 8: Left side of assignment operator must be variable or property.
if (_root.username.text == "test" && _root.password.text --> = <-- "test") {


??

Lynx75
03-26-2003, 05:42 PM
aehm,ok 8)
got it!


tnx!

8)