Foros del Web » Creando para Internet » Flash y Actionscript »

getElementById en AS

Estas en el tema de getElementById en AS en el foro de Flash y Actionscript en Foros del Web. Hola buenas. Mi pregunta es la siguiente... Tengo la siguiente estrucctura @import url("http://static.forosdelweb.com/clientscript/vbulletin_css/geshi.css"); Código xml: Ver original <form >     <formitem >     ...
  #1 (permalink)  
Antiguo 27/07/2009, 04:28
 
Fecha de Ingreso: julio-2008
Ubicación: Alcañiz-Teruel-España
Mensajes: 182
Antigüedad: 15 años, 9 meses
Puntos: 5
getElementById en AS

Hola buenas.

Mi pregunta es la siguiente...

Tengo la siguiente estrucctura

Código xml:
Ver original
  1. <form>
  2.     <formitem>
  3.         <textinput id ='campo001'> </textinput>
  4.     </formitem>
  5.     <formitem>
  6.         <textinput id ='campo002'> </textinput>
  7.     </formitem>
  8.     <formitem>
  9.         <textinput id ='campo003'> </textinput>
  10.     </formitem>
  11. </form>

Me gustaría saber como accdeder al elemento por medio de su id. He estado investigando y he encontrado esto:

Código actionscript:
Ver original
  1. var miTextInput:TextInput = new TextInput()
  2. miTextInput = this['campo001']
  3. Alert.show ('El valor de '+miTextInput.id +' es '+miTextInput.text )

Pero no me functiona...

Espero me puedan decir...

Saludos
__________________
Si quieres puedes y si puedes debes. Imposible is nothing!!!

Última edición por matak; 27/07/2009 a las 07:11
  #2 (permalink)  
Antiguo 27/07/2009, 17:38
 
Fecha de Ingreso: mayo-2008
Ubicación: Murcia, España
Mensajes: 313
Antigüedad: 16 años
Puntos: 5
Respuesta: getElementById en AS

A ver... Esto es flex?, si lo es la sintaxis del XML no está bien...

Para acceder al elemento a través de su id haces esto:

iddelelemento.text = "hola cambio el texto...";
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 13:50.