Hey all…
I’m having some trouble getting some data from an xml file to be properly interpreted in flash…the traces of myType (for each tile in the grid) come up as undefined…
here is a sample of my xml:
<?xml version=“1.0” ?>
- <LEVEL>
- <ROW>
<CELL type="../../oekeki/pictures/50.jpg" />
<CELL type="../../oekeki/pictures/50.jpg" />
<CELL type="../../oekeki/pictures/50.jpg" />
<CELL type="" />
<CELL type="../../oekeki/pictures/50.jpg" />
<CELL type="" />
<CELL type="" />
<CELL type="" />
<CELL type="" />
<CELL type="../../oekeki/pictures/50.jpg" />
</ROW>
// Update tile grid based on XML
function drawGridXML(myXML) {
// Iterate through the rows
for (var gH:Number = 0; gH < level.gridHeight; ++gH) {
// Iterate through the columns
for (var gW:Number = 0; gW < level.gridWidth; ++gW) {
// Get the name and type for the tile
var myName:String = tileName(gW,gH);
var myType:String = myXML.firstChild.childNodes[gH].childNodes[gW].attributes.type;
// Set the tile
origin[myName].loadMovie(myType);
trace (myType);
}
}
}
Is my syntax wrong in the var myType line or is the variable just not being passed because of something else?
Thanks for you guys help as always! Any info would be helpful of course!
- KarmaKat