Con expresiones regulares puede ser algo asi:
Código XML:
Ver original<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="955" minHeight="600">
<mx:Script>
<![CDATA[
protected function check_clickHandler(event:MouseEvent):void
{
var value:String = input_txt.text;
var numReg:RegExp = /^[0-9]+$/;
var alphaReg:RegExp = /^[a-zA-Z]+$/;
if ( numReg.test( value ) )
{
out.text = "Escribiste solo numeros";
return
}
if ( alphaReg.test( value ) )
{
out.text = "Escribiste solo letras";
return
}
out.text = "No hay macth"
}
]]>
</mx:Script>
<mx:Panel width="400" height="150" layout="absolute" horizontalCenter="0" verticalCenter="0">
<mx:Label x="10" y="10" text="Inserta un texto"/>
<mx:TextInput y="8" left="115" right="100" id="input_txt"/>
<mx:Button y="8" label="Verifica" right="10" id="check" click="check_clickHandler(event)"/>
<mx:Label x="10" width="360" textAlign="center" fontSize="15" id="out" top="50"/>
</mx:Panel>
</mx:Application>
Saludos!!