Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    Link da foto caricate da file xml

    Ciao
    ho una galleria immagini che carica foto esterne da un file xml.
    La galleria funziona così:
    c'è una barra con le anteprime che scorre, cliccando sulla foto piccola apre la foto grande.
    Ora ho l'esigenza che cliccando sulla foto grande mi apra uno zoom o un link esterno in cui posso mettere lo zoom.
    Mi potete aiutare??????
    Per essere più chiara vi riporto il codice in flash:
    descriptions = true;
    // box descrizione invisibile
    alert._visible = false;
    // effetto ease
    var ease = 5;
    //imposto la scala della foto grande
    _root.scala_x = 80;
    _root.scala_y = 80;
    //imposto la barra visibile
    _root.barra_stato = "true";
    _root.box.useHandCursor = false;
    //leggo i dati XML
    thumbs = new XML();
    thumbs.ignoreWhite = true;
    thumbs.load("datiautunno2011.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 = 60;
    h = 55;
    mask._width = 469;
    mask._height = h+30;
    forward._x = mask._width+5;
    forward._y = back._y=h/2;
    mcs = [];
    for (i=0; i<total; i++) {
    mcs.push(i);
    newThumb = thumbnailer.container.duplicateMovieClip("containe r"+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.desc = root.childNodes[i].childNodes[1].firstChild.nodeValue;
    newThumb.link = root.childNodes[i].childNodes[2].firstChild.nodeValue;

    loadMovie(image1, _root.box.foto_effetto);
    _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
    newThumb.cont2.loadMovie(image);
    //carico le thumbs e le scalo
    newThumb.cont._xscale = 14;
    // scalo la larghezza
    newThumb.cont._yscale = 14;
    // scalo l'altezza delle ombre associate alle immagini
    newThumb.cont2._xscale = newThumb.cont._xscale;
    newThumb.cont2._yscale = 1;
    newThumb.onRelease = function() {
    loadMovie(this.image, _root.box.foto_effetto);
    // carico l'immagine nel clip effetto
    _root.box.play();
    // avvio il box
    _root.box._xscale = _root.scala_x;
    // scalo la larghezza
    _root.box._yscale = _root.scala_y;
    // scalo l'altezza
    };

    newThumb.onReleaseOutside = function() {
    this._xscale = 100;
    this._yscale = 100;
    this._y = this._y+1;
    this._x = this._x+5;
    };
    if (descriptions) {
    newThumb.onRollOver = function() {
    alert.desc = this.desc;
    alert._visible = true;
    this._xscale = 100;
    this._yscale = 100;
    this._y = this._y-10;
    this._x = this._x-5;
    this.swapDepths(9);
    };
    newThumb.onRollOut = function() {
    alert._visible = false;
    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;
    };
    };

  2. #2
    Prova ad aggiungere il codice rosso.
    In alternativa ti basterebbe mettere un pulsnte invisibile sopra a tutto e poi gli cambi il link dinamicamente.

    codice:
    descriptions = true;
    // box descrizione invisibile
    alert._visible = false;
    // effetto ease
    var ease = 5;
    //imposto la scala della foto grande
    _root.scala_x = 80;
    _root.scala_y = 80;
    //imposto la barra visibile
    _root.barra_stato = "true";
    _root.box.useHandCursor = false;
    //leggo i dati XML
    thumbs = new XML();
    thumbs.ignoreWhite = true;
    thumbs.load("datiautunno2011.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 = 60;
    	h = 55;
    	mask._width = 469;
    	mask._height = h+30;
    	forward._x = mask._width+5;
    	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.desc = root.childNodes[i].childNodes[1].firstChild.nodeValue;
    		newThumb.link = root.childNodes[i].childNodes[2].firstChild.nodeValue;
    
    		loadMovie(image1, _root.box.foto_effetto);
    		_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
    		newThumb.cont2.loadMovie(image);
    		//carico le thumbs e le scalo
    		newThumb.cont._xscale = 14;
    		// scalo la larghezza
    		newThumb.cont._yscale = 14;
    		// scalo l'altezza delle ombre associate alle immagini
    		newThumb.cont2._xscale = newThumb.cont._xscale;
    		newThumb.cont2._yscale = 1;
    		newThumb.onRelease = function() {
    			loadMovie(this.image, _root.box.foto_effetto);
    			// carico l'immagine nel clip effetto
    			_root.box.play();
    			// avvio il box
    			_root.box._xscale = _root.scala_x;
    			// scalo la larghezza
    			_root.box._yscale = _root.scala_y;
    			// scalo l'altezza
    		};
    
    		newThumb.onReleaseOutside = function() {
    			this._xscale = 100;
    			this._yscale = 100;
    			this._y = this._y+1;
    			this._x = this._x+5;
    		};
    		if (descriptions) {
    			newThumb.onRollOver = function() {
    				alert.desc = this.desc;
    				alert._visible = true;
    				this._xscale = 100;
    				this._yscale = 100;
    				this._y = this._y-10;
    				this._x = this._x-5;
    				this.swapDepths(9);
    			};
    			newThumb.onRollOut = function() {
    				alert._visible = false;
    				this._xscale = 100;
    				this._yscale = 100;
    				this._y = this._y+10;
    				this._x = this._x+5;
    			};
    		}
    		_root.box.foto_effetto.onRelease = function() {
    			getURL("http://www.html.it");
    		} 
    	}
    	//
    	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;
    	};
    };

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.