Modified Kirupa Slide Show

I have posted about this project before, but have come to a few revelations about it. Any help would be greatly appreciated.

First of, here is the actionscript. It is basically the slideshow tutorial on this website, just slightly modified for this project.


//agent.loadMovie("agent_photo.swf",1);


delay = 1200;
//-----------------------
function loadXML(loaded) {

if (loaded) {

xmlNode = this.firstChild;
image = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image* = xmlNode.childNodes*.childNodes[21].firstChild.nodeValue;//listing_image
image2* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
bed* = xmlNode.childNodes*.childNodes[9].firstChild.nodeValue;
bath* = xmlNode.childNodes*.childNodes[10].firstChild.nodeValue;
garages* = xmlNode.childNodes*.childNodes[11].firstChild.nodeValue;
price* = xmlNode.childNodes*.childNodes[12].firstChild.nodeValue;
address* = xmlNode.childNodes*.childNodes[5].firstChild.nodeValue;
city* = xmlNode.childNodes*.childNodes[6].firstChild.nodeValue;
_state* = xmlNode.childNodes*.childNodes[7].firstChild.nodeValue;
zip* = xmlNode.childNodes*.childNodes[8].firstChild.nodeValue;
agent_name* = xmlNode.childNodes*.childNodes[13].firstChild.nodeValue;
agent_address* = xmlNode.childNodes*.childNodes[14].firstChild.nodeValue;
agent_city* = xmlNode.childNodes*.childNodes[16].firstChild.nodeValue;
agent_state* = xmlNode.childNodes*.childNodes[17].firstChild.nodeValue;
agent_zip* = xmlNode.childNodes*.childNodes[18].firstChild.nodeValue;
agent_email* = xmlNode.childNodes*.childNodes[20].firstChild.nodeValue;
agent* = xmlNode.childNodes*.childNodes[21].firstChild.nodeValue;






}

firstImage();
} else {

content = "file not loaded!";

}

}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("prodigy_featured.xml");
/////////////////////////////////////
nextImage();

p = 0;
this.onEnterFrame = function() {

filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
filesize = agent.getBytesTotal();
loaded = agent.getBytesLoaded();
preloader._visible = true;

if (loaded != filesize) {

preloader.preload_bar._xscale = 100*loaded/filesize;

} else {

preloader._visible = true;
if (picture._alpha<100) {
picture._alpha += 10;

}

}

};
function nextImage() {

if (p<(total-1)) {

p++;
if (loaded == filesize) {
picture.loadMovie(image[p]);
agent.loadMovie(image[p])
picture._alpha = 0;
house.loadMovie(image2[p]);
house._alpha = 100;
garages.text = garages[p];
bath.text = bath[p];
bed.text = bed[p];
zip.text = zip[p];
_state.text = _state[p];
city.text =  city[p];
address.text =  address[p];
price.text =  price[p];
agent_name.text = agent_name[p];
agent_address.text = agent_address[p];
agent_city.text = agent_city[p];
agent_state.text = agent_state[p];
agent_zip.text = agent_zip[p];
agent_email.text = agent_email[p];
picture_num();
slideshow();
}

}

}
function prevImage() {

if (p>0) {

p--;
picture.loadMovie(image[p], 1);
agent.loadMovie(image[p])
picture._alpha = 0;
house.loadMovie(image2[p]);
house._alpha = 100;
garages.text = garages[p];
bath.text = bath[p];
bed.text = bed[p];
zip.text = zip[p];
_state.text = _state[p];
city.text =  city[p];
address.text =  address[p];
price.text =  price[p];
agent_name.text = agent_name[p];
agent_address.text = agent_address[p];
agent_city.text = agent_city[p];
agent_state.text = agent_state[p];
agent_zip.text = agent_zip[p];
agent_email.text = agent_email[p];
picture_num();

}

}
function firstImage() {

if (loaded == filesize) {


picture.loadMovie(image[p]);
agent.loadMovie(image[p])
picture._alpha = 0;
house.loadMovie(image2[p]);
house._alpha = 100;
garages.text = garages[p];
bath.text = bath[p];
bed.text = bed[p];
zip.text = zip[p];
_state.text = _state[p];
city.text =  city[p];
address.text =  address[p];
price.text =  price[p];
agent_name.text = agent_name[p];
agent_address.text = agent_address[p];
agent_city.text = agent_city[p];
agent_state.text = agent_state[p];
agent_zip.text = agent_zip[p];
agent_email.text = agent_email[p];
slideshow();

}

}
function picture_num() {

current_pos = p+1;
pos_txt.text = current_pos+" / "+total;

}
function slideshow() {

myInterval = setInterval(pause_slideshow, delay);
function pause_slideshow() {

clearInterval(myInterval);
if (p == (total-1)) {

p = 0;
firstImage();

} else {

nextImage();

}

}

}


Here is my issue. the last variable that calls the xml data:


agent* = xmlNode.childNodes*.childNodes[21].firstChild.nodeValue;

Gives me a Security Sandox error. I originally thought this was the case, but if I change the variable (image) to call the child variable (ChildNodes[21]) It works just fine. The only line that gives me a problem is the last one in the row. Everything else works exactly as it should. Now, I solved this problem by calling in a remote swf that cycles through the pic, but because if the lag calling the data, the pictures are not synced with data.

I know I have posted this before, but if someone, anyone could take a look at this and give me some sort of direction I would be grateful. If you have any questions, please feel free to let me know.