Comunidad de diseño web y desarrollo en internet online

Tipos de datos incompatibles?? Números enteros

Citar            
MensajeEscrito el 01 Abr 2009 12:26 pm
Hola amigos!

Tengo lo siguiente:

Código :

var nfotos:Number = noticias_xml.firstChild.childNodes[num].childNodes.length
                  
cambia_tam = mesk._width / nfotos
mesk._width = cambia_tam


Haber, si pongo esto así no me redimensiona el objeto pero si lo cambio por lo siguiente:

Código :

nfotos = noticias_xml.firstChild.childNodes[num].childNodes.length
                        
cambia_tam = mesk._width / 2 //-------> si cambio la variable por un número entero
mesk._width = cambia_tam


Resulta que si me hace el cambio de tamaño en el objeto.
No entiendo por qué... sabéis que ocurre??

Gracias!! :P

Por cotk

61 de clabLevel



 

safari
Citar            
MensajeEscrito el 01 Abr 2009 06:21 pm
todo depndera del valor que te este regresando "noticias_xml.firstChild.childNodes[num].childNodes.length"
has un trace para verificarlo, puede ser que te de undefined.

Código ActionScript :

var nfotos:Number = noticias_xml.firstChild.childNodes[num].childNodes.length
                  
cambia_tam = mesk._width / nfotos
mesk._width = cambia_tam

Por LongeVie

Claber

1741 de clabLevel

1 tutorial

Genero:Masculino  

En un lugar, re moto.

msie7

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.