alpha = function (target, vel, to) { target.vel = vel; target.to = to; target.alpha_init = target._alpha; target.onEnterFrame = function() { updateAfterEvent(); if (target.to != undefined && target.vel != undefined) { if (target.to>target.alpha_init) { if (target._alpha<=100) { target._alpha += target.vel; } else { target.onEnterFrame = null; } } else if (target._alpha>target.to) { target._alpha -= target.vel; } else { target.onEnterFrame = null; } } else { } }; }; function parse(success) { if (success) { var imgArr = new Array(); var tmp = this.firstChild; _self.numPause = Number(this.firstChild.attributes.timer*1000); _self.order = this.firstChild.attributes.order; _self.looping = this.firstChild.attributes.looping; _self.fadeTime = Number(this.firstChild.attributes.fadetime); var Register_1_ = tmp.lastChild; var Register_2_ = 0; while (Register_1_.nodeName != null) { imageData = new Object(); imageData.path = Register_1_.attributes.path; imgArr[Register_2_] = imageData; var Register_1_ = Register_1_.previousSibling; Register_2_++; } imgArr.reverse(); imageGen(imgArr); } else { } } function swapPlace(clip, num) { _self[clip].swapDepths(_self["loader"+num+"_mc"]); } function loadImages(data, num) { if (i == undefined || i == 2) { i = 2; createLoader(i, data, num); i = 1; } else if (i == 1) { createLoader(i, data, num); i = 2; } } function createLoader(i, data, num) { thisLoader = _self["loader"+i+"_mc"]; thisLoader._alpha = 0; thisLoader.loadMovie(data[num].path); watcher_mc.onEnterFrame = function() { var Register_2_ = thisLoader.getBytesLoaded(); var Register_1_ = thisLoader.getBytesTotal(); if (isNaN(Register_1_) || Register_1_<4) { } else if (Register_2_/Register_1_>=1) { swapPlace("loader2_mc", 1); alpha(thisLoader, _self.fadeTime, 100); timerInterval = setInterval(imageGen, _self.numPause, data); delete this.onEnterFrame; } }; } function imageGen(data) { if (_self.order == "random") { while (randomNum == randomNumLast) { randomNum = Math.floor(Math.random()*data.length); } loadImages(data, randomNum); randomNumLast = randomNum; } else if (_self.order == "sequential") { if (p == undefined || p == data.length && _self.looping == "yes") { p = 0; } else { } loadImages(data, p); p++; } clearInterval(timerInterval); } function init(file) { _self = this; randomNum = 0; randomNumLast = 0; this.createEmptyMovieClip("loader1_mc", 2); this.createEmptyMovieClip("loader2_mc", 1); this.createEmptyMovieClip("watcher_mc", 100); images_xml = new XML(); images_xml.ignoreWhite = true; images_xml.onLoad = parse; images_xml.load(file); } this.onUnload = function() { clearInterval(timerInterval); }; if (file) { init(file); }