tags:

views:

129

answers:

1
var str:String=cntslst.text;      
var results:Array = str.split(",");
for(i=0;i<result.length;i++)
{<mx:NumberValidator source="{result[i]}" property="text" id="cell" />}

is it possible ?

+3  A: 

You can use the PhoneNumberValidator class, instantiated in either AS3 or MXML is fine. Don't set the source or property properties unless you want validation error UI to appear.

You can then call the validate method on that instance for each string and check to see if the results property of the ValidationResultEvent that is returned is null or empty.

var validator:PhoneNumberValidator; //instantiate how you like
var result:ValidationResultEvent = validator.validate(str);
var isPhoneNumber:Boolean = result.results == null || result.results.length == 0;
Rhysyngsun
Thank you very much for answering
Thirst for Excellence
You should mark it as the answer so others know in the future. Thanks.
Rhysyngsun