I am very new to this, so please bare with me. Can anyone help me put the thumbs in a 3 column, 3 row grid?
I tried using the file on this thread:
But when I click on one of the thumbs i get this:
Error opening URL “file:///Macintosh%20HD/Users/MacDaddy/Desktop/CurrentWork/FLASH%26XML%20TUTORIAL/test/undefined”
I know everyone is probably sick of the photogallery stuff, but it’s all very new to me and I’d really appreciate the help.
Thanks
can anybody help with this… … please
What’s the code your using, or post a .fla…
scotty(-:
how do I post so that the code is in a scroll area?
I’m using this, its from one of your old posts:
var thumb_spacing = 76;
var thumb_height = 60;
// number of columns you want
var columns = 3;
// number of rows you want
var rows = 3;
function GeneratePortfolio(portfolio_xml) {
var portfolioPictures = portfolio_xml.firstChild.childNodes;
var positionX = 0;
// var to determine how much pages there will be
var pages;
// put everything inside scroll_mc
var scroll_mc = menu_mc.createEmptyMovieClip("scroll_mc", 99);
// mask scroll mc
scroll_mc.setMask(mask);
for (var i = 0; i<portfolioPictures.length; i++) {
var currentPicture = portfolioPictures*;
var currentThumb_mc = scroll_mc.createEmptyMovieClip("thumbnail_mc"+i, i);
// returns the number of pages
pages = Math.floor((i/(rows*columns)));
// position of the different pages
var pageing = pages*(columns*thumb_spacing);
// thumb x position
currentThumb_mc._x = (i%columns)*thumb_spacing+pageing;
// thumb y position
currentThumb_mc._y = (Math.floor(i/columns)%rows)*thumb_height;
currentThumb_mc.createEmptyMovieClip("thumb_container", 0);
currentThumb_mc.thumb_container.loadMovie(currentPicture.attributes.thumb);
currentThumb_mc.image = currentPicture.attributes.image;
currentThumb_mc.imgurl = currentPicture.attributes.imgurl;
currentThumb_mc.onRelease = function() {
image_mc.holder.loadMovie(this.image);
image_mc.theurl = this.imgurl;
image_mc.onRelease = function() {
getURL(this.theurl, _blank);
};
image_mc.onRollOver = function() {
this.attachMovie("rollme", "myroll", 1);
};
image_mc.onRollOut = function() {
this.myroll.removeMovieClip();
};
};
currentThumb_mc.onRollOver = function() {
this.attachMovie("rollit", "newroll", 2);
this.newroll._alpha = 40;
};
currentThumb_mc.onRollOut = function() {
this.newroll.removeMovieClip();
};
}
// if there are more then 1 page
if (pages>0) {
for (var i = 0; i<=pages; i++) {
// attach a button for each page
var pag = this.attachMovie("page_btn", "page"+i, 99+i);
// position of the btton
pag._x = 25+i*50;
pag._y = 350;
// identifier for the button
pag.id = i;
// button text
pag.info.text = i+1;
pag.onPress = function() {
// show the right page
// you could add some easing...
menu_mc.scroll_mc._x = -(this.id*(columns*thumb_spacing));
};
}
}
}
// xml object for xml content
var portfolio_xml = new XML();
portfolio_xml.ignoreWhite = true;
portfolio_xml.onLoad = function(success) {
if (success) {
GeneratePortfolio(this);
} else {
trace("Error loading XML file");
}
};
// load
portfolio_xml.load("portfolio2.xml");
And then I down loaded portfolio2.xml to go along with it:
<?xml version="1.0" encoding="UTF-8"?>
<menu>
<image source="pics/pic5.jpg" thumb="pics/th5.jpg" title="Agreement"/>
<image source="pics/pic6.jpg" thumb="pics/th6.jpg" title="Whales"/>
<image source="pics/pic7.jpg" thumb="pics/th7.jpg" title="Bridge"/>
<image source="pics/pic8.jpg" thumb="pics/th8.jpg" title="Sunset"/>
<image source="pics/pic9.jpg" thumb="pics/th9.jpg" title="My Girlfriend"/>
<image source="pics/pic4.jpg" thumb="pics/th4.jpg" title="Greetings from Holland"/>
<image source="pics/pic5.jpg" thumb="pics/th5.jpg" title="Agreement"/>
<image source="pics/pic6.jpg" thumb="pics/th6.jpg" title="Whales"/>
<image source="pics/pic6.jpg" thumb="pics/th6.jpg" title="Whales"/>
<image source="pics/pic7.jpg" thumb="pics/th7.jpg" title="Bridge"/>
<image source="pics/pic8.jpg" thumb="pics/th8.jpg" title="Sunset"/>
<image source="pics/pic1.jpg" thumb="pics/th1.jpg" title="Snow"/>
<image source="pics/pic2.jpg" thumb="pics/th2.jpg" title="Cat and Dog"/>
<image source="pics/pic3.jpg" thumb="pics/th3.jpg" title="Relief"/>
<image source="pics/pic3.jpg" thumb="pics/th3.jpg" title="Relief"/>
<image source="pics/pic2.jpg" thumb="pics/th2.jpg" title="Cat and Dog"/>
<image source="pics/pic3.jpg" thumb="pics/th3.jpg" title="Relief"/>
<image source="pics/pic4.jpg" thumb="pics/th4.jpg" title="Greetings from Holland"/>
<image source="pics/pic5.jpg" thumb="pics/th5.jpg" title="Agreement"/>
<image source="pics/pic6.jpg" thumb="pics/th6.jpg" title="Whales"/>
<image source="pics/pic7.jpg" thumb="pics/th7.jpg" title="Bridge"/>
<image source="pics/pic8.jpg" thumb="pics/th8.jpg" title="Sunset"/>
</menu>
On first sight, the code seems ok, can you post your files?
scotty(-:
Thanks, here is the flash file & XML file.
any thoughts???
In the AS look for this line
currentThumb_mc.image = currentPicture.attributes.image;
it refers at the wrong attribute, it should read
currentThumb_mc.image = currentPicture.attributes.source;
scotty(-:
thats wicked, thanks very much scotty!!!
no problem :thumb: