Tema: XML y Flash
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 05/08/2009, 07:22
Avatar de Offrenbaruna
Offrenbaruna
 
Fecha de Ingreso: octubre-2004
Mensajes: 537
Antigüedad: 19 años, 6 meses
Puntos: 1
XML y Flash

Hola a todos, tengo un problema cargando los datos de mi XML en mi flash

Este es mi XML

Código PHP:
<?xml version="1.0" encoding="utf-8"?>
<gallery>    
    <image imgBigEx="img_big_01.jpg" thumEx="img_thum_01.jpg" />
    <image imgBigEx="img_big_02.jpg" thumEx="img_thum_02.jpg" />
    <image imgBigEx="img_big_03.jpg" thumEx="img_thum_03.jpg" />
    <!-- THUMBNAIL -->
    <image imgBigIn="img_big_01.jpg" thumIn="img_thum_01.jpg" />
    <image imgBigIn="img_big_02.jpg" thumIn="img_thum_02.jpg" />
    <image imgBigIn="img_big_03.jpg" thumIn="img_thum_03.jpg" />            
</gallery>
y aqui esta mi AS

Código PHP:
var bigImg:Array = new Array();
var 
modelNum;
var 
whichImgBig;
var 
whichThum;
var 
whichGallery "photoExterior";
var 
switchGallery;
var 
switchGalleryThum;
var 
whichModelBigEx;
var 
whichModelBigThumEx;
var 
whichModelBigIn;
var 
whichModelThumIn;

var 
myXML:XML = new XML();
myXML.ignoreWhite true;
myXML.onLoad = function(success){
    var 
allTheModels myXML.firstChild.childNodes;
    for (var 
i=0i<allTheModels.lengthi++) {
        var 
modelNum allTheModels.length;
        
vawhichModelBigEx allTheModels[i].attributes.imgBigEx;
        
whichModelBigThumEx allTheModels[i].attributes.thumEx;
        
whichModelBigIn allTheModels[i].attributes.imgBigIn;
        
whichModelThumIn allTheModels[i].attributes.thumIn;
        
//trace (modelNum)
        
trace(whichModelBigEx)
        
trace(whichModelBigThumEx)
        
trace(whichModelBigIn)
        
trace(whichModelThumIn)
        if (
success){
        
//trace("XML Fully Loaded")
        
}
    }
}
myXML.load("gallery.xml"); 
Mi problema es que mi AS no lee todos los atributos de un solo jalon de mi XML, ignora o cuando pongo el trace solo muestra parte de mis atributos o marca undifined

The thing is that I want to trace all the element from my XML in other word all the children from my root and I don't know how to do it or what I'm doing wrong !
La cosa es que quiero que muestre todos mis elementos de mi XML, en otras palabras todos los children de mi root de mi XML i no se como hacerlo o no se que estoy haciendo mal, si hay un experto en el tema con objetos en XML lo apreciaria infinitamente.

Gracias.
A little help please !
__________________