Ciao a tutti,
sono alle prese con un problemone.
Ho applicato con successo su un sito il seguente script di Julius:
http://www.juliusdesign.net/dynamic-...re-scorrevoli/
Il codice actionscript (che riporto in coda) carica le thumbnails scalandole di un certa percentuale rispetto alla dimensione originale, per cui nella barra di scorrimento in basso (movieclip "barra") avrò thumbnails grandi e piccole insieme, mentre io vorrei invece applicare a tutte le miniature la stessa dimensione (70x70), quindi stretchandole in modo che tutte siano uguali.
Ho già provato ad agire sui valori di scaling (variabili "w", "h", "_xscale", ecc...) ma raggiungo il mio obiettivo solo se ho immagini della stessa dimensione, mentre se (come nel mio caso) ho immagini di dimensioni anche molto diverse ottengo un risultato obrobrioso...
Ecco il codice, purtroppo non sono molto ferrata in actionscript per cui se qualcuno di voi avesse la pazienza di aiutarmi a capire come modificare il codice per impostare i thumbnails su un valore fisso in pixel, mi farebbe una grossa gentilezza!![]()
Spero di aver spiegato bene il problema, diversamente fatemi sapere!
Ecco il codice, ancora grazie!![]()
t.
codice:// imposta a false se non vuoi la descrizione descriptions = false; // box descrizione invisibile alert._visible = false; // effetto ease var ease = 5; //imposto la scala della foto grande _root.scala_x = 100; _root.scala_y = 100; //imposto la barra visibile _root.barra_stato = "true"; _root.box.useHandCursor = false; //leggo i dati XML thumbs = new XML(); thumbs.ignoreWhite = true; thumbs.load("dati.xml"); // qui inserire il percorso al file .XML thumbs.onLoad = function() { root = this.firstChild; total = root.childNodes.length; displayNum = Number(root.childNodes[0].attributes.displayNum); separation = Number(root.childNodes[0].attributes.separation); //settings w = 86.3; h = 70; mask._width = displayNum*(w+separation); mask._height = h+30; forward._x = mask._width+12; forward._y = back._y=h/2; mcs = []; for (i=0; i<total; i++) { mcs.push(i); newThumb = thumbnailer.container.duplicateMovieClip("container"+i, i); with (newThumb) { _x = (w+separation)*i; preloader._x = w/2; preloader._y = h/2; shape._width = w; shape._height = h; } var image = root.childNodes[i].childNodes[0].firstChild.nodeValue; var image1 = root.childNodes[0].childNodes[0].firstChild.nodeValue; newThumb.image = root.childNodes[i].childNodes[0].firstChild.nodeValue; newThumb.link = root.childNodes[i].childNodes[2].firstChild.nodeValue; // carico la prima foto _root.box._xscale = _root.scala_x; // scalo la larghezza _root.box._yscale = _root.scala_y; // scalo l'altezza newThumb.onRelease(); newThumb.cont.loadMovie(image); //carico le thumbs e le scalo newThumb.cont._xscale = 13.8; // scalo la larghezza newThumb.cont._yscale = 18.4; newThumb.onRelease = function() { loadMovie(this.image, _root.holder_gallery_bassa.box.foto_effetto); _root.varimmagine = this.image; // carico l'immagine nel clip effetto _root.holder_gallery_bassa.box.play(); // avvio il box _root.holder_gallery_bassa.box._xscale = _root.scala_x; // scalo la larghezza _root.holder_gallery_bassa.box._yscale = _root.scala_y; // scalo l'altezza }; newThumb.onReleaseOutside = function() { this._xscale = 100; this._yscale = 100; this._y = this._y+10; this._x = this._x+5; }; } // var offset = total-1; var dest = 0; var increment = w+separation; var ending = (total-displayNum)*(w+separation); var lastmc = total-1; var firstmc = 0; back.onRelease = function() { if (dest<0) { dest += increment; } else { first = mcs[0]; for (k=0; k<total; k++) { mcs[k] = mcs[k+1]; } mcs[total-1] = first; thumbnailer["container"+lastmc]._x = -(w+separation); firstmc = lastmc; //check whos new lastmc for (k=0; k<total; k++) { if (mcs[k] == (total-1)) { lastmc = k; } } } }; forward.onRelease = function() { if (dest>-ending) { dest -= increment; } else { last = mcs[total-1]; for (k=1; k<total; k++) { mcs[total-k] = mcs[total-k-1]; } mcs[0] = last; thumbnailer["container"+firstmc]._x = (displayNum)*(w+separation); lastmc = firstmc; //check whos new firstmc for (k=0; k<total; k++) { if (mcs[k] == 0) { firstmc = k; } } } }; //movement onEnterFrame = function () { for (j=0; j<total; j++) { thumbnailer["container"+j]._x += (dest+(mcs[j])*(w+separation)-thumbnailer["container"+j]._x)/ease; } alert._x = _xmouse; alert._y = _ymouse; }; };

Rispondi quotando
