package{ import flash.display.Sprite; public class Main extends Sprite{ public function Main(){ var sEmail:String = new String("someone@someserver.com"); var bValidEmail:Boolean = true; var nAmpIndex:int = sEmail.indexOf("@"); var nDotIndex:int = sEmail.lastIndexOf("."); if(nAmpIndex == -1 || nDotIndex == -1) { bValidEmail = false; } if(!(nAmpIndex > 0)) { bValidEmail = false; } if(!(nDotIndex > nAmpIndex)) { bValidEmail = false; } if(!(nDotIndex < sEmail.length - 1) || !(nDotIndex > nAmpIndex + 1)) { bValidEmail = false; } trace(bValidEmail); } }}
Name (required)
email (will not be published) (required)
Website