When I click on a a set of MovieClips that I populated with XML, I want to be able to dynamically populate ANOTHER MovieClip. Why can’t I do this with the code I have written? The problem code is in red below.
ActionScript 2.0:
furniture_xml = new XML();
furniture_xml.ignoreWhite = true;
furniture_xml.onLoad = function(success) {
if (success) {
var pieces_xml = furniture_xml.firstChild;
var totalF = pieces_xml.childNodes.length;
for (var i = 0; i < totalF; i++) {
var pieceData = new Object();
aa = _root["furnHolder" + i];
aa.furn_link_mc.loadMovie(pieces_xml.childNodes*.attributes.thumb, this.getNextHighestDepth());
[COLOR=Red]aa.onRelease = function(){
for (var i = 0; i < 4; i++){
_root.bigFurniture.loadMovie(pieces_xml.childNodes*.firstChild.nodeValue;, this.getNextHighestDepth());
}
}[/COLOR]
}
} else {
trace(“Error loading furniture.”);
}
delete furniture_xml;
}
furniture_xml.load(“furniture.xml”);
XML:
<furniture>
<piece thumb=“images/furniture0_sm.jpg”>images/furniture0.jpg</piece>
<piece thumb=“images/furniture1_sm.jpg”>images/furniture1.jpg</piece>
<piece thumb=“images/furniture2_sm.jpg”>images/furniture2.jpg</piece>
<piece thumb=“images/furniture3_sm.jpg”>images/furniture3.jpg</piece>
</furniture>