I have a swf that loads a thumbnail gallery of CD covers from an XML. I finally got it working in a scrollpane thanks to one of the blog articles here. when you click on a cover thumb, it displays a larger picture and some info in some holders outside of the scrollpane.
All of that works fine. but I am not able to get the scrollbars to register that the content has exceeded the scrollpane. I understand that you need to use
scrollPane.invalidate();
to refresh the pane, and I have included it, but to no avail. Has anyone else had this issue and solved it? my thoughts were that it had to be included in the function that created the movie, but I tried it at different levels even, and with the same result. Anyone care to take a gander?
http://www.fileden.com/files/2006/9/24/237882/SmokeyPane.rar for the files and .fla
var thumb_spacing = 100;
var row_spacing = 100;
var description_lv = new LoadVars();
description_lv.onData = function(raw_text){
description_txt.text = raw_text;
}
var mcMain:MovieClip;
function init() {
scrollPane.contentPath = "scrollMovieClip";
mcMain = scrollPane.content;
}
init();
function GeneratePortfolio(portfolio_xml){
var columns = 3;
var columnNum = 0;
var rowNum = 0;
var portfolioPictures = portfolio_xml.firstChild.childNodes;
for (var i = 0; i < portfolioPictures.length; i++){
var currentPicture = portfolioPictures*;
mcMain.createEmptyMovieClip("thumbnail_mc"+i,i);
if (columnNum>columns-1) {
columnNum = 0;
rowNum++;
}
mcMain["thumbnail_mc"+i]._x = columnNum * thumb_spacing;
mcMain["thumbnail_mc"+i]._y = (rowNum * row_spacing);
mcMain["thumbnail_mc"+i].createEmptyMovieClip("thumb_container",0);
mcMain["thumbnail_mc"+i].thumb_container.loadMovie(currentPicture.attributes.thumb);
mcMain["thumbnail_mc"+i].title = currentPicture.attributes.title;
mcMain["thumbnail_mc"+i].image = currentPicture.attributes.image;
mcMain["thumbnail_mc"+i].description = currentPicture.attributes.description;
mcMain["thumbnail_mc"+i].onRollOver = mcMain["thumbnail_mc"+i].onDragOver = function(){
info_txt.text = this.title;
}
mcMain["thumbnail_mc"+i].onRollOut = mcMain["thumbnail_mc"+i].onDragOut = function(){
info_txt.text = "";
}
mcMain["thumbnail_mc"+i].onRelease = function(){
image_mc.loadMovie(this.image);
description_lv.load(this.description);
}
scrollPane.invalidate();
columnNum++;
}
}
var portfolio_xml = new XML();
portfolio_xml.ignoreWhite = true;
portfolio_xml.onLoad = function(success){
if (success) GeneratePortfolio(this);
else trace("Error loading XML file");
}
portfolio_xml.load("portfolio2.xml");
Thanks
-John-