Validate Email With ActionScript
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="150">
<mx:Script>
import mx.events.ValidationResultEvent;
import mx.validators.EmailValidator;
private var isValid:Boolean;
public var emailValidator:EmailValidator = new EmailValidator();
public var validator:ValidationResultEvent;
public function validate():void {
emailValidator.source = email;
emailValidator.property = "text";
validator = emailValidator.validate();
}
</mx:Script>
<mx:Panel title="Validate with ActionScript" width="210" height="75">
<mx:HBox width="100%" height="100%" paddingLeft="3" paddingTop="3">
<mx:TextInput id="email" width="100"/>
<mx:Button label="Validate" click="validate()" />
</mx:HBox>
</mx:Panel>
</mx:Application>
Related examples in the same category