as3登陆界面
import flash.events.TextEvent;
import flash.events.MouseEvent;
ucode.restrict = "a-zA-Z0-9";
uname.restrict = "a-zA-Z0-9@.";
var regex:RegExp=new RegExp("^[\\w-]+(\\.[\\w-]+)*@[\\w-]+(\\.[\\w-]+)+$");
var email1:String=uname.text;//"yan.net@126.com";
uname.addEventListener(TextEvent.TEXT_INPUT,doText);
function doText(e:TextEvent):void{
var t:String = regex.test(uname.text)?"是":"不是";
if(t=='不是')
umes.text = "用户名为邮箱地址";
else
umes.text = '';
}
loginbtn.buttonMode = true;
loginbtn.addEventListener(MouseEvent.CLICK,doLogin);
function doLogin(e:MouseEvent):void{
//login action
}