Sooner or later you will face with the small quest of validating an email address for your flash application. The following script is a basic script and should not be used for websites that relay heavily on the email address is being requested (shopping carts, credit card transactions and so forth)

ActionScript:
  1. function isValidEmail(e) {
  2. if (e.indexOf("@") != -1 && ( e.indexOf(".") > e.indexOf("@") ) ){
  3. trace("success");
  4. }else{
  5. trace("error");
  6. }
  7. }
  8.  
  9. //Test
  10. isValidEmail("test@test.com");
  11.