Question
XML and an array to call attachMovie
As my slideshow moves through my nodes I want to be able to
call attachMovie and place a MC on the stage. I have got this far:
function parse():Void {
if (xmlData.firstChild.nodeName == "girls") {
var rootNode:XMLNode = xmlData.firstChild;
}
for (i=0; i<rootNode.childNodes.length; i++)
myArray.push(rootNode.childNodes .nodeName);
}
trace(myArray.length);
if (myArray)
{_this.attachMovie("mcgirl1", "girl_mc", this.getNextHighestDepth(), {_x:Stage.width / 2, _y:Stage.height / 2});
}
The last part of the code from "if" is nonsense but I hope it suitably demonstrates what I'm trying to do. I want the actionscript to follow which node of the xml I'm in and then complete a function.
I have got confused because I see the XML as array, but I have to 'push' that array onto another array to acheive some output?
If anyone can help I'd be very happy.
Chris
function parse():Void {
if (xmlData.firstChild.nodeName == "girls") {
var rootNode:XMLNode = xmlData.firstChild;
}
for (i=0; i<rootNode.childNodes.length; i++)
myArray.push(rootNode.childNodes .nodeName);
}
trace(myArray.length);
if (myArray
{_this.attachMovie("mcgirl1", "girl_mc", this.getNextHighestDepth(), {_x:Stage.width / 2, _y:Stage.height / 2});
}
The last part of the code from "if" is nonsense but I hope it suitably demonstrates what I'm trying to do. I want the actionscript to follow which node of the xml I'm in and then complete a function.
I have got confused because I see the XML as array, but I have to 'push' that array onto another array to acheive some output?
If anyone can help I'd be very happy.
Chris
