hi, i’m working on a jukebox, attempting to pull in an external swf that has within it code to access an external xml file as well as external swf file. everything is fine when the external swf is exported, and the information that is supposed to be read from the xml file into the swf shows up fine. when i attempt to load the external swf into a movie clip called ‘empty’ within the main jukebox, none of the xml info shows up within it. i believe that i could add action script to explain to the external movie clip that it will be loading within the mc ‘empty’, but as i did not write the code and am not an action script guru, i don’t really know how to go about it. i’m going to post the code here, and a quick response would be greatly appreciated. just don’t know where to put the reference to ‘empty’ within the code. thanks!
#include “XMLnitro.as”
path = _url.substr(0, _url.lastIndexOf("/"))+"/";
function processXML() {
tracks_array = [];
tracks_count = this.firstChild.childNodes.length;
trace(“tracks_count=”+tracks_count);
mainTag = this.firstChild;
// xml sample:
// <?xml version="1.0" ?>
// <track_list>
// <track>
// <file_url>ag_elanao.swf</file_url>
// <artist>Agape</artist>
// <track_name>Ela Nao Gosta De Mim</track_name>
// <album>Brazil Classics 2</album>
// <asin_number>B00004RD0U</asin_number>
// </track>
// </track_list>
for (var h = 0; h<tracks_count; h++) {
track = {};
track.file_name = mainTag.childNodes[h].childNodes[0].firstChild.nodeValue;
trace (track.file_name);
track.artist_name = mainTag.childNodes[h].childNodes[1].firstChild.nodeValue;
trace (track.artist_name);
track.track_name = mainTag.childNodes[h].childNodes[2].firstChild.nodeValue;
trace (track.track_name);
track.album_name = mainTag.childNodes[h].childNodes[3].firstChild.nodeValue;
trace (track.album_name);
track.asin_number = mainTag.childNodes[h].childNodes[4].firstChild.nodeValue;
trace (track.asin_number);
track.item_id = mainTag.childNodes[h].childNodes[5].firstChild.nodeValue;
trace (track.item_id);
track.playlist_id = mainTag.childNodes[h].childNodes[6].firstChild.nodeValue;
trace (track.playlist_id);
tracks_array.push(track);
}
// trace(Slides_array[0].image_swf);
_root.current_track = 0;
loadmusic();
//_root.nextFrame();
}
testXML = new XML();
testXML.ignoreWhite = true;
testXML.onLoad = processXML;
xmlpath = path+“xml/”;
//filetoload = “test.xml”;
filetoload = “mix_latin.xml”;
trace(“filepath=”+filetoload);
testXML.load(filetoload);
function loadmusic () {
trace("_root.current_track="+current_track);
trace("track to play= "+_root.tracks_array[current_track].file_name);
filetoload = path+"swf/"+tracks_array[(current_track)].file_name;
trace ("filetoload= "+filetoload);
artist = tracks_array[(current_track)].artist_name;
trace ("artist_name= "+ artist);
track = tracks_array[(current_track)].track_name;
trace ("track_name= "+ track);
album = tracks_array[(current_track)].album_name;
trace ("album_name= "+ album);
asin=tracks_array[(current_track)].asin_number;
trace ("asin_number="+ asin +"!");
item=tracks_array[(current_track)].item_id;
trace ("item_id="+ item +"!");
playlist=tracks_array[(current_track)].playlist_id;
trace ("playlist_id="+ item +"!");
if (asin.length<1){
_root.buy_clip.gotoAndStop("1");
} else{
_root.buy_clip.gotoAndStop("2");
}
_root.image_holder.image_one.loadMovie(filetoload);
}
function gonext () {
if (_root.current_track<(_root.tracks_count-1)) {
_root.current_track++;
} else {
_root.current_track = 0;
}
loadmusic();
}
function goprev () {
if (_root.current_track>0) {
_root.current_track–;
} else {
_root.current_track = _root.tracks_count-1;
}
loadmusic();
}
stop();