I just want to say how great this place is, the web site I’m working on is only my second attempt to make a flash site and I’ve learned a lot from the tutorials and just from people collaborating on the forums.
So I’m pretty close to completing the current project I’m working on but I’ve run into a small snag. The “video” section of the web page looks good (buttons/scroll work and thumbnail appear Etc.) when I preview it off-line in flash. But when I’ve tried to view it on the net it doesnt seems to show up correctly - buttons seems to work yet no thumbsnails appear. This particular section is using some code that I believe Scotty originally posted for a image gallery/portfolio, I’m actually using it (or a variation of it) in two other sections (images and roster) without any problems but for some reason the video section isn’t working when on-line.
here’s my AS (I haven’t cleaned it up - so you gonna see a few things rem’ed out)
var thumb_spacing = 110;
var columns = 5;
//variable for the chosen gallery
var index = 0;
//variable we need later to remove the "old" thumbs
var currentLength;
// load variables object to handle loading of text
var description_lv = new LoadVars();
description_lv.onData = function(raw_text) {
description_txt.text = raw_text;
};
function Generatevideo(video_xml, t) {
//remove the old thumbs
for (var i = 0; i<currentLength; i++) {
//box is the mc inside menu_mc, where the thumbs are loaded
menu_mc.box["thumbnail_mc"+i].removeMovieClip();
}
var videoPictures = video_xml.childNodes;
//set currentlength to the current amount of thumbs
currentLength = videoPictures.length;
for (var i = 0; i<videoPictures.length; i++) {
var currentPicture = videoPictures*;
//box is the mc inside menu_mc, where the thumbs are loaded
var currentThumb_mc = menu_mc.box.createEmptyMovieClip("thumbnail_mc"+i, i);
currentThumb_mc._x = 5+(i%columns)*thumb_spacing;
currentThumb_mc._y = 5+Math.floor(i/columns)*thumb_spacing;
currentThumb_mc.createEmptyMovieClip("thumb_container", 0);
currentThumb_mc.thumb_container.loadMovie(currentPicture.attributes.thumb);
currentThumb_mc.title = currentPicture.attributes.title;
currentThumb_mc.image = currentPicture.attributes.image;
currentThumb_mc.description = currentPicture.attributes.description;
currentThumb_mc.onRollOver = currentThumb_mc.onDragOver=function () {
info_txt.text = this.title;
};
currentThumb_mc.onRollOut = currentThumb_mc.onDragOut=function () {
info_txt.text = "";
};
currentThumb_mc.onRelease = function() {
//image_mc.loadMovie(this.image);
getURL(this.image, "_blank");
description_lv.load(this.description);
};
}
//activate the back and forward button (t = the amount of galleries in the xml
setvideoNr(t);
//image_mc.loadMovie(menu_mc.box.thumbnail_mc0.image );
//interval fort the scroller to be sure all thumbs are created and you have
//the correct height of menu_mc.box
delay = setInterval(setScroller, 250);
}
// xml object for xml content (defines sources for selections)
//I've made this a function so you can call it again
function choosevideo(index) {
var video_xml = new XML();
video_xml.ignoreWhite = true;
video_xml.onLoad = function(success) {
if (success) {
var gallery = this.firstChild.childNodes[index];
//set the gallery name
galleryInfo.text = this.firstChild.childNodes[index].attributes.title;
//get the amount of galleries
var totalGalleries = this.firstChild.childNodes.length;
Generatevideo(gallery, totalGalleries);
} else {
trace("Error loading XML file");
}
// no success? trace error (wont be seen on web)
};
// load
video_xml.load("video.xml");
}
//function for the back.fwd buttons
function setvideoNr(t) {
back_btn.onRelease = function() {
index>0 ? index-- : index=t-1;
//set the chosen gallery
choosevideo(index);
};
fwd_btn.onRelease = function() {
index<t-1 ? index++ : index=0;
//set the chosen gallery
choosevideo(index);
};
}
//function for the visibility of the scroller
function setScroller() {
//clear the interval
clearInterval(delay);
//if there are not enough thumbs, set the scroller invisible and the variable
//in menu_mc to 0 (see there)
if (menu_mc.box._height<menu_mc.mask._height) {
menu_mc.slide._visible = menu_mc.dragger._visible=0;
menu_mc.vis = 0;
} else {
//there are enough thumbs, so the scroller is visible and we can scroll
menu_mc.slide._visible = menu_mc.dragger._visible=1;
menu_mc.dragger._y = 1;
menu_mc.vis = 1;
}
}
//aet the first gallery
choosevideo(0);
///preloader - IMAGE
//this.onEnterFrame = function () {
// filesize = this.image_mc.getBytesTotal();
//loaded = this.image_mc.getBytesLoaded();
//imagepreloader._visible = true;
//if (loaded != filesize) {
// imagepreloader.imagepreloaderbar._xscale = 100*loaded/filesize;
//} else {
// imagepreloader._visible = false;
// }
//};
I’m supposed to complete the site this evening so any assistance anyone could give would be great.
Thanks,
-DC
UPDATE - Well I gave the code yet another look and I figured what was wrong. the directory holding the files on the server had the first letter in caps - it was “Video” instead of “video”, once I change it all to lower case the issue was resolved - was unware that the code was case-sensitive.