fscommand("allowscale", "false");
sfx = new Sound();
sfx.onSoundComplete = function () { trace("Sound Effect Complete"); }
slides_xml = new XML();
slides_xml.onLoad = startSlideShow;
slides_xml.load("album.xml");
slides_xml.ignoreWhite = true;
//-------------------------------------------------------------------------------
function startSlideShow(success) {
if (success == true) {
rootNode = slides_xml.firstChild;
totalSlides = rootNode.childNodes.length;
firstSlideNode = rootNode.firstChild;
currentSlideNode = firstSlideNode;
currentIndex = 1;
updateSlide(firstSlideNode);
}
}
//-------------------------------------------------------------------------------
function updateSlide(newSlideNode) { // update photo, description, and status field
imagePath = newSlideNode.attributes.jpegURL;
infoBox.photoText = newSlideNode.firstChild.nodeValue;
statusField = currentIndex + "/" + totalSlides;
//loadMovie(imagePath,"ShowMyWork");
trace(imagePath);
loadPicture(imagePath);
}
//-----------------------------------------------------------------------------
function loadPicture(imagePath){
var listener:Object=new Object();
var mcLoader:MovieClipLoader=new MovieClipLoader()
this.createEmptyMovieClip("holder",this.getNextHighestDepth());
//----------------------------------------------------------------------------------------
listener.onLoadStart=function(target:MovieClip)
{
trace("Gestart met laden van " + target._url + " in " + target._name);
trace("De breedte van " + target._name + " wordt " + target._width);
trace("-------------------------------------------------------");
}
//----------------------------------------------------------------------------------------
listener.onLoadProgress=function(target:MovieClip, geladenbytes:Number,totaalbytes:Number)
{
trace("Bezig met laden van :" + target._url + " in " + target._name);
trace("Procent geladen :" + Math.round((geladenbytes/totaalbytes)*100) + " %")
trace("De breedte van " + target._name + " wordt " + target._width);
trace("-------------------------------------------------------");
}
//-----------------------------------------------------------------------------------------
listener.onLoadComplete=function(target:MovieClip, httpStatus:Number)
{
trace("onLoadComplete: Gedaan met laden van :" + target._url + " in " + target._name);
trace("httpStatus: " + httpStatus);
trace("De breedte van " + target._name + " wordt " + target._width);
trace("-------------------------------------------------------");
}
//-----------------------------------------------------------------------------------------
listener.onLoadInit=function(target:MovieClip)
{
target._xscale=50;
target._yscale=50;
trace(target);
trace("------");
trace("onLoadInit: Gedaan met laden van :" + target._url + " in " + target._name);
trace("De breedte van " + target._name + " wordt " + target._width);
trace("-------------------------------------------------------");
}
//-----------------------------------------------------------------------------------------
listener.onLoadError=function(target:MovieClip, errorCode:String, httpStatus:Number)
{
trace("Fout ivm met laden van :" + target._url + " in " + target._name);
trace("ErrorCode: " + errorCode);
trace("httpStatus: " + httpStatus);
trace("-------------------------------------------------------");
}
//-----------------------------------------------------------------------------------------
mcLoader.loadClip(imagePath,holder)
mcLoader.addListener(listener)
}
//-------------------------------------------------------------------------------
function slideShow() {
nextSlideNode = currentSlideNode.nextSibling;
if (nextSlideNode == null) {
currentIndex = 1;
updateSlide(firstSlideNode);
currentSlideNode = firstSlideNode;
} else {
currentIndex++;
updateSlide(nextSlideNode);
currentSlideNode = nextSlideNode;
}
}
//-------------------------------------------------------------------------------
function nextButton() { // event handler for next button
nextSlideNode = currentSlideNode.nextSibling;
if (nextSlideNode == null) {
break;
} else {
currentIndex++;
updateSlide(nextSlideNode);
currentSlideNode = nextSlideNode;
}
}
//-------------------------------------------------------------------------------
function prevButton() { // event handler for prev button
previousSlideNode = currentSlideNode.previousSibling;
if (previousSlideNode != null) {
currentIndex--;
currentSlideNode = previousSlideNode;
updateSlide(previousSlideNode);
}
}