scroll di thumb
-
salve gente, sono nuovo e spero possiate darmi una mano. Ho fatto un giro ma non ho trovato nulla in mio aiuto. Ho una galleria di immagini con relative thumb che vengono caricate da file xml. Vorrei far scorrere le thumb come in questo sito ma non riesco a farlo.
C'è un limite al numero delle foto inserite sempre riguardo allo scorrimento?
Vi posto anche il codice della gallery a 2 pulsanti fashion01 fashion02 così si capisce meglio..fashion01_arr = new Array(); fashion02_arr = new Array(); btnRef_arr = new Array(); my_xml = new XML(); my_xml.ignoreWhite = true; my_xml.onLoad = function(success) { if (success) { searchXML(); } else { trace("xml not loaded"); } }; my_xml.load("images.xml"); function searchXML() { var allxml = my_xml.firstChild.firstChild; do { var arr = _root[allxml.nodeName+"_arr"]; var ch = allxml.firstChild; do { arr.push(ch.childNodes); } while (ch=ch.nextSibling); } while (allxml=allxml.nextSibling); } fash01_btn.onRelease = function() { thumbRemover(); holder_mc.SequentailImages(fashion01_arr); }; fash02_btn.onRelease = function() { thumbRemover(); holder_mc.SequentailImages(fashion02_arr); }; MovieClip.prototype.SequentailImages = function(images) { this.curImage = 0; this.images = images; this.ImageFromSequence(); this.onEnterFrame = function() { var clipLoaded = this.imageClip.getBytesLoaded(); var clipTotal = this.imageClip.getBytesTotal(); var percent = clipLoaded/clipTotal; if (percent == 1) { this.imageClip.onRollOver = function() { this._alpha = 100; }; this.imageClip.onRollOut = this.imageClip.onDragOut=function () { this._alpha = 50; }; this.imageClip.onRelease = function() { image_mc.loadMovie(this.id.images[this.idx]+".jpg"); }; this.imageClip.id = this; this.imageClip.idx = this.curImage; this.curImage++; if (this.curImage>=this.images.length) { this.onEnterFrame = undefined; imageGen(images); } else { this.ImageFromSequence(); } } }; }; MovieClip.prototype.ImageFromSequence = function() { this.imageClip = this.createEmptyMovieClip("thumb"+this.curImage+"_mc", this.curImage); this.imageClip.loadMovie(this.images[this.curImage]+"_th.jpg"); this.imageClip._x = 65*this.curImage; this.imageClip._alpha = 50; btnRef_arr.push(this.imageClip); }; function thumbRemover() { for (var n = 0; n<btnRef_arr.length; n++) { btnRef_arr[n].removeMovieClip(); } } MovieClip.prototype.alpha = function(vel, to) { this.vel = vel; this.to = to; this.alpha_init = this._alpha; this.onEnterFrame = function() { updateAfterEvent(); if (this.to != undefined && this.vel != undefined) { if (this.to>this.alpha_init) { if (this._alpha<=100) { this._alpha += this.vel; } else { this.onEnterFrame = null; } } else { if (this._alpha>this.to) { this._alpha -= this.vel; } else { this.onEnterFrame = null; } } } }; }; var randomNum, randomNumLast, xpos, ypos = 0; _global.numPause = 4000; _global.fadetime = 2; image_mc.createEmptyMovieClip("loader1_mc", 2); image_mc.createEmptyMovieClip("loader2_mc", 1); this.createEmptyMovieClip("watcher_mc", 100); function swapPlace(clip, num) { eval(clip).swapDepths(eval("image_mc.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 = eval("image_mc.loader"+i+"_mc"); thisLoader._alpha = 0; thisLoader.loadMovie(data[num]+".jpg"); watcher_mc.onEnterFrame = function() { var picLoaded = thisLoader.getBytesLoaded(); var picBytes = thisLoader.getBytesTotal(); if (isNaN(picBytes) || picBytes<4) { return; } if (picLoaded/picBytes>=1) { swapPlace("image_mc.loader2_mc", 1); thisLoader.alpha(_global.fadeTime, 100); timerInterval = setInterval(imageGen, _global.numPause, data); delete this.onEnterFrame; } }; } function imageGen(data) { if (p == undefined || p == data.length) { p = 0; } loadImages(data, p); p++; clearInterval(timerInterval); }Grazie milleeee!!
-
-
Ciao! Sembra che tu sia interessato a questa conversazione, ma non hai ancora un account.
Stanco di dover scorrere gli stessi post a ogni visita? Quando registri un account, tornerai sempre esattamente dove eri rimasto e potrai scegliere di essere avvisato delle nuove risposte (tramite email o notifica push). Potrai anche salvare segnalibri e votare i post per mostrare il tuo apprezzamento agli altri membri della comunità.
Con il tuo contributo, questo post potrebbe essere ancora migliore 💗
Registrati Accedi
