/ Published in: ActionScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function mailTrue(mailType:String):Boolean { var t:String = mailType; var tmpArray:Array = t.split("@"); if (tmpArray.length != 2) { trace("ARRAY NON VALIDO"); return; } trace("continuo a STEP 1"); var tLen:Number = tmpArray[1].length; var tmpChar = tmpArray[1]; var tmpCharZero = tmpArray[0].length if (tLen<2 || tmpCharZero<2) { return; } trace("continuo a STEP 2"); for (var i:Number = tLen; i>0; i--) { if (tmpChar.charAt(i) == ".") { trace("TROVATO DOT"); newPoint = i; afterDot = tmpChar.substr(newPoint, tLen); (afterDot.length>=2) ? (myValue=true) : (myValue=false); trace("continuo a STEP 3"); break; } } return myValue; }