Ver Mensaje Individual
  #2 (permalink)  
Antiguo 21/05/2009, 08:18
Avatar de carlxime
carlxime
 
Fecha de Ingreso: marzo-2007
Ubicación: México
Mensajes: 180
Antigüedad: 17 años, 1 mes
Puntos: 6
Respuesta: Volver formulario a estado inicial

Hola Carla,

Pensando en que el nombre de instancia de tu combobox sea cbo_paises y el nombre de instancia de tu campo de texto sea nombre_txt:

Código actionscript:
Ver original
  1. borrar_btn.onRelease = function()
  2. {
  3.     cbo_paises.selectedIndex = 0;
  4.     nombre_txt.text = "";
  5. }
  6.  
  7. enviar_btn.onRelease = function()
  8. {
  9.         if(esVacio(nombre_txt.text))
  10.         {
  11.                 nombre_txt.text = 1;
  12.         }
  13. }
  14.  
  15. function esVacio(texto:String)
  16. {
  17.     var _vacio:Boolean = true;
  18.     for(var i:Number = 0; i < texto.length; i++)
  19.     {
  20.         if(texto.charAt(i) != " " && texto.charCodeAt(i) != 13)
  21.         {
  22.             _vacio = false;
  23.             break;
  24.         }
  25.     }
  26.     return _vacio;
  27. }

Saludos.
__________________
http://codigometropoli.com