Estoy leyendo en un archivo XML en AS3. Necesito averiguar si un atributo existe en un nodo. Quiero hacer algo como:¿Cómo puedo probar si un atributo se ha establecido en un nodo XML utilizando AS3
if(xmlIn.attribute("id")){
foo(xmlIn.attribute("id"); // xmlIn is of type XML
}
Esto no funciona sin embargo. La instrucción if anterior siempre es verdadera, incluso si la identificación del atributo no está en el nodo.
Gracias, pensé que mi solución era hacky. El método hasOwnProperty hizo el truco. – Boundless
¿Cómo se verifica si está vacío? – Livi17