PDA

View Full Version : AS: Loading first picture in XML gallery...



Sirenetta1
August 13th, 2005, 08:06 PM
Hello,

The XML gallery I have has a pop-up window that appears after selecting a thumbnail. What I'm trying to accomplish is for the first picture in the gallery to load into the pop-up window, which is now always shown on the stage.

I was able to make it so that the pop-up is always visible, but one thing I couldn't figure out is how to make it so that the first picture in the gallery loads into the pop-up box WITHOUT the user selecting the thumbnail first?? :crying:

I think it has to do with this code:


portfolio_xml.onLoad = function(success) {
if (success) {
var gallery = this.firstChild.childNodes[index];
galleryInfo.text = this.firstChild.childNodes[index].attributes.title;
var totalGalleries = this.firstChild.childNodes.length;
GeneratePortfolio(gallery, totalGalleries);
window.loadPic(this.image);
//set the variable cur in mc window to the current picture
window.cur = this.id;
//call function in mc window for setting the next and prev buttons +info text (see there)
window.setPrefPop(0);
} else {
trace("Error loading XML file");
}
};
portfolio_xml.load("portfolio.xml");
}

Can you help? I thought that window.loadPic (this.image) would work, but it doesn't? I'll attach the gallery to this posting.

scotty
August 14th, 2005, 04:40 AM
Call the onRelease function for the first thumb:)

function setScroller() {
//added
menu_mc.box.thumbnail_mc0.onRelease();
clearInterval(delay);
if (menu_mc.box._height<menu_mc.mask._height) {
menu_mc.slide._visible = menu_mc.dragger._visible=0;
menu_mc.vis = 0;
} else {
menu_mc.slide._visible = menu_mc.dragger._visible=1;
menu_mc.dragger._y = 1;
menu_mc.vis = 1;
}
}

scotty(-:

Sirenetta1
August 14th, 2005, 10:52 AM
Thanks again, Scotty!! I really appreciate how you help me because I learn much more actionscript because of you. Thanks so much for helping me!! :thumb:

scotty
August 14th, 2005, 11:12 AM
no problem ;)