Flex . Verificarea daca un field e gol sau nu

 
import mx.controls.Alert;
public function CheckName():void {
if 	(name.text == "") 
Alert.show('Enter your name','Alert Box', mx.controls.Alert.OK); 
else 
 currentState = 'MainWindow';
}