import mx.transitions.Tween;
import mx.transitions.easing.*;
_root.preloader.elotoltoszamlalo = "...";
_root.kepcime = "loading...";
_root.szamlalo = " ";
var myShowXML = new XML();
myShowXML.ignoreWhite = true;
myShowXML.load("slideshow.xml");
myShowXML.onLoad = function() {
_root.galeria.myWidth = myShowXML.firstChild.attributes.width;
_root.galeria.myHeight = myShowXML.firstChild.attributes.height;
_root.galeria.mySpeed = myShowXML.firstChild.attributes.speed;
_root.galeria.myImages = myShowXML.firstChild.childNodes;
_root.galeria.myImagesNo = myImages.length;
createContainer();
callImages();
};
function createContainer() {
_root.galeria.createEmptyMovieClip("myContainer_mc",1);
myContainer_mc._x = 0;
myContainer_mc._y = 0;
}
function callImages() {
_root.galeria.myMCL = new MovieClipLoader();
_root.galeria.myPreloader = new Object();
_root.galeria.myMCL.addListener(_root.galeria.myPreloader);
_root.galeria.myClips_array = [];
_root.galeria.myPreloader.onLoadStart = function(target) {
};
_root.galeria.myPreloader.onLoadProgress = function(target) {
_root.preloader.elotoltoszamlalo = _root.galeria.myClips_array.length+" of "+_root.galeria.myImagesNo;
};
_root.galeria.myPreloader.onLoadComplete = function(target) {
_root.galeria.myClips_array.push(target);
target._alpha = 0;
if (_root.galeria.myClips_array.length == _root.galeria.myImagesNo) {
_root.preloader.elotoltoszamlalo = " ";
_root.galeria.target_mc = -1;
myShowInt = setInterval(SlideshowStart, (_root.galeria.mySpeed*1000)+1000);
clearInterval(myShowInt);
kovetkezo();
}
};
for (i=0; i<_root.galeria.myImagesNo; i++) {
temp_url = _root.galeria.myImages[i].attributes.url;
temp_mc = myContainer_mc.createEmptyMovieClip(i, myContainer_mc.getNextHighestDepth());
_root.galeria.myMCL.loadClip(temp_url,temp_mc);
}
}
_root.Slide_sound.slideshow_button.start_button.onRelease = function() {
SlideshowStart();
myShowInt = setInterval(SlideshowStart, (_root.galeria.mySpeed*1000)+1000);
};
function SlideshowStart() {
current_mc = _root.galeria.myClips_array[_root.galeria.target_mc];
new Tween(current_mc, "_alpha", Strong.easeOut, 100, 0, 1, true);
_root.galeria.target_mc++;
if (_root.galeria.target_mc>=_root.galeria.myImagesNo) {
_root.galeria.target_mc = 0;
}
_root.kepcime = _root.galeria.myImages[target_mc].attributes.title;
_root.szamlalo = _root.galeria.myImages[target_mc].attributes.szam+" of "+_root.galeria.myImagesNo;
next_mc = _root.galeria.myClips_array[_root.galeria.target_mc];
new Tween(next_mc, "_alpha", Strong.easeOut, 0, 100, 1, true);
}
_root.Slide_sound.slideshow_button.stop_button.onRelease = function() {
clearInterval(myShowInt);
};
_root.Slide_sound.previous_button.onRelease = function() {
elozo();
clearInterval(myShowInt);
};
_root.Slide_sound.next_button.onRelease = function() {
kovetkezo();
clearInterval(myShowInt);
};
function kovetkezo() {
current_mc = _root.galeria.myClips_array[_root.galeria.target_mc];
new Tween(current_mc, "_alpha", Strong.easeOut, 100, 0, 1, true);
_root.galeria.target_mc++;
if (_root.galeria.target_mc>=_root.galeria.myImagesNo) {
_root.galeria.target_mc = 0;
}
_root.kepcime = _root.galeria.myImages[target_mc].attributes.title;
_root.szamlalo = _root.galeria.myImages[target_mc].attributes.szam+" of "+_root.galeria.myImagesNo;
next_mc = _root.galeria.myClips_array[_root.galeria.target_mc];
new Tween(next_mc, "_alpha", Strong.easeOut, 0, 100, 1, true);
}
function elozo() {
if (_root.galeria.target_mc>0) {
current_mc = _root.galeria.myClips_array[_root.galeria.target_mc];
new Tween(current_mc, "_alpha", Strong.easeOut, 100, 0, 1, true);
_root.galeria.target_mc--;
_root.kepcime = _root.galeria.myImages[target_mc].attributes.title;
_root.szamlalo = _root.galeria.myImages[target_mc].attributes.szam+" of "+_root.galeria.myImagesNo;
next_mc = _root.galeria.myClips_array[_root.galeria.target_mc];
new Tween(next_mc, "_alpha", Strong.easeOut, 0, 100, 1, true);
}