Variables


i have generic password validater on site.
basicly have mc (password_mc)
inside have 3 feilds , 1 button
1. dynamic text field (alertmessage)
2. input text (userid)
3. input text (password)
4. button (log in)

on button have following code. reason have absolute paths, because doesent work
"this" reason.

all want validate if putting in correct ui & password. if not write in dynamic feild didn't. or if don't fill feilds, didn't enter it. simple. can't difficult. have done in flash 4 in , worked. not sure i'm missing here.

what's weird works if have charecter in feilds.



on(release){
if(_root.password_mc.username=="" or _root.password_mc.password==null){
_root.password_mc.alertmessage=="please enter user name";
}
else if(_root.password_mc.password=="" or _root.password_mc.password==null){
_root.password_mc.alertmessage=="please enter password";
}
else if(_root.password_mc.username=="test" or _root.password_mc.password=="test1"){
this._visible=false;
_root.applications_mc_ac._visible=true
}
else if(_root.password_mc.username!="test" or _root.password_mc.password!="test1"){
_root.password_mc.alertmessage=="wrong username & password";

}
}

you shuld use this... assume you've assigned name "username" text filed "username" , password text filed "password".
if(_root.password_mc.username.text=="" || _root.password_mc.password.text==""){
_root.password_mc.alertmessage.text=="please enter user name/password";
}

use "||" rather "or"

and on...


More discussions in ActionScript 1 and 2


adobe

Comments

Popular posts from this blog

Thread: PKI Client 5.00 install (for eToken Pro)

ATmega2560-Arduino Pin Mapping

Crossfader Arduino Tutorial