a grand renaming so that the most significant portion of the name comes first

This commit is contained in:
Dan Buch
2012-03-03 21:45:20 -05:00
parent c8b8078175
commit f4f448926d
1300 changed files with 0 additions and 234 deletions

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
backgroundColor="#FFFFFF"
backgroundAlpha="0"
xmlns:me="com.mycustom.components.*">
<mx:Form>
<mx:FormItem label="Email Address:" >
<me:TextInputEmail />
</mx:FormItem>
<mx:FormItem>
<mx:Button label="Submit" />
</mx:FormItem>
</mx:Form>
</mx:Application>

View File

@@ -0,0 +1,35 @@
package com.mycustom.components
{
import mx.controls.TextInput;
import mx.events.ValidationResultEvent;
import mx.validators.EmailValidator;
import flash.events.Event;
import mx.validators.ValidationResult;
public class TextInputEmail extends TextInput
{
private var emailValidator:EmailValidator = new EmailValidator();
private var validator:ValidationResultEvent;
public function TextInputEmail()
{
super();
this.emailValidator.source = this;
this.emailValidator.property = "text";
this.addEventListener("enter", this.validate);
}
private function validate(event:Event):void
{
validator = emailValidator.validate();
if (validator.type == ValidationResultEvent.VALID)
{
this.errorString = "";
} else {
this.errorString = validator.message;
}
}
}
}