Flex 3 o superior.
Hola como se pueden hacer validaciones simples con Flex.
tal como se hacen en javascript con html.
Como la imagen:
aparezca un alert diciendo si es correcto o no es correcto.
Código Flex:
Ver original<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
<fx:Declarations>
<mx:Script>
<![CDATA[
import mx.controls.Alert;
private function valida_vacios():void {
myInput.text == "";
Alert.show("Ingrese un numero", "Error", Alert.OK);
}
]]>
</mx:Script>
<mx:Button x="96" y="109" id="myButton"
click="valida_vacios();"/>
<s:Label x="17" y="22" text="Ingreso No Vacio" id="myInput" />
<s:Label x="19" y="58" text="Solo Numeros"/>
<s:TextInput x="119" y="17"/>
<s:TextInput x="112" y="48"/>
<s:Label x="19" y="88" text="Solo Letras"/>
<s:TextInput x="96" y="78"/>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
</s:Application>