Comunidad de diseño web y desarrollo en internet online

Galeria fotográfica - Ayuda

Citar            
MensajeEscrito el 07 Sep 2008 06:06 pm
Hola peña,
no me gusta escribir estos codigos largos pero queria saber si me podeis ayudar, es una galeria con una barra (solo que esta colocaca a la derecha de forma vertical, yo la quiero poner abajo y que sea horizontal;

Código :

larghezzamovie = Stage.height;

posSin = 1;
vel = -3;
dimImm = 179;
selezione._x = 100;
letto = false;

pos_iniziale = Stage.width-dimImm;
_root.mc_desc.sf_desc._width = pos_iniziale;

leggi = function () {
   nuovo = new XML();
   nuovo.ignoreWhite = true;
   nuovo.load("file.xml");
   nuovo.onLoad = function(success) {
      if (success) {
         nfoto = this.childNodes.length;
         posDes = nfoto;
         for (i=0; i<nfoto; i++) {
            _root.attachMovie("mc","mc"+(i+1),i+1);
            _root["mc"+(i+1)]._y = dimImm*i;
            _root["mc"+(i+1)]._x = pos_iniziale;
            _root["mc"+(i+1)].big = this.childNodes[i].attributes.photo_big;
            _root["mc"+(i+1)].desc = this.childNodes[i].attributes.descrizione;
            _root["mc"+(i+1)].contenitore.loadMovie(this.childNodes[i].attributes.photo);
            _root["mc"+(i+1)]._alpha = 50;
            _root.box.clip_mc.loadMovie(this.childNodes[0].attributes.photo_big);
            _root.pre.loadMovie(this.childNodes[i].attributes.photo_big);
            _root.image = this.childNodes[0].attributes.photo_big;
            _root.mc_desc.descrizione.text = this.childNodes[0].attributes.descrizione;
            _root["mc"+(i+1)].onRelease = released;
            _root["mc"+(i+1)].onRollOver = rollover;
            _root["mc"+(i+1)].onRollOut = rollout;
            _root["mc"+(i+1)].onReleaseOutside = rollout;
         }
         letto = true;
      } else {
         _root.didascalia.text = "errore di lettura";
      }
   };
};
leggi();

_root.onMouseMove = function() {
   x = _root._xmouse;
   y = _root._ymouse;
   if (x>pos_iniziale) {
      if (y>0 && y<60) {
         vel = -(Math.round((y-(larghezzamovie/2))/10));

      }
      if (y>260 && y<larghezzamovie) {
         vel = -(Math.round((y-(larghezzamovie/2))/10));

      }
   } else {
      if (vel>-1) {
         vel = 3;
      } else {
         vel = -3;
      }
   }

};
function released() {

   _root.image = this.big;
   _root.box.play();
   _root.box.clip_mc.loadMovie(_root.image);
   _root.mc_desc.descrizione.text = this.desc;
   //_root.selezione._y = (larghezzamovie)/2;
   //_root.didascalia.text = this.etichetta.text;

   //getURL(percorso,"_blank")
}

function rollover() {
   this._alpha = 100;


}


function rollout() {
   this._alpha = 50;

}

_root.onEnterFrame = function() {
   if (letto) {
      for (i=1; i<=nfoto; i++) {
         _root["mc"+i]._y += vel;
      }
      if (vel>0 && _root["mc"+posSin]._y>0) {
         _root["mc"+posDes]._y = _root["mc"+posSin]._y-dimImm;
         posSin = posDes;
         posDes--;
         if (posDes == 0) {
            posDes = nfoto;
         }
      }
      if (vel<0 && _root["mc"+posSin]._y<=-dimImm) {
         _root["mc"+posSin]._y = _root["mc"+posDes]._y+dimImm;
         posDes = posSin;
         posSin++;
         if (posSin>nfoto) {
            posSin = 1;
         }
      }
   }
};


Gracias, Un saludo.

(Si necesitas algo más, por favor pedirmelo.

Por lobo-david

Claber

167 de clabLevel



 

Puerta del Sol, Madrid

safari
Citar            
MensajeEscrito el 08 Sep 2008 01:24 pm
Se que es algo de

Código :

._y
._x
pero no consigo que me salga bien.

Por lobo-david

Claber

167 de clabLevel



 

Puerta del Sol, Madrid

safari
Citar            
MensajeEscrito el 08 Sep 2008 06:41 pm
Este es el archivo original:

Ver

Y esto es lo que he consegido:

Ver

El unico problema que tengo ahora es que no se mueve bien porque el movimiento solo ocurre cuando pasamos por donde estaba situada antes la barra:



"Con la imagen se entiende mejor"

Este es el codigo del segundo ejemplo:

Código :

larghezzamovie = Stage.height;

posSin = 1;
vel = -3;
dimImm = 195;
selezione._y = 100;
letto = true;

pos_iniziale = Stage.width-dimImm;
_root.mc_desc.sf_desc._width = pos_iniziale;

leggi = function () {
   nuovo = new XML();
   nuovo.ignoreWhite = true;
   nuovo.load("file.xml");
   nuovo.onLoad = function(success) {
      if (success) {
         nfoto = this.childNodes.length;
         posDes = nfoto;
         for (i=0; i<nfoto; i++) {
            _root.attachMovie("mc","mc"+(i+1),i+1);
            _root["mc"+(i+1)]._y = 420;
            _root["mc"+(i+1)]._x = ( dimImm * i );
            _root["mc"+(i+1)].big = this.childNodes[i].attributes.photo_big;
            _root["mc"+(i+1)].desc = this.childNodes[i].attributes.descrizione;
            _root["mc"+(i+1)].contenitore.loadMovie(this.childNodes[i].attributes.photo);
            _root["mc"+(i+1)]._alpha = 50;
            _root.box.clip_mc.loadMovie(this.childNodes[0].attributes.photo_big);
            _root.pre.loadMovie(this.childNodes[i].attributes.photo_big);
            _root.image = this.childNodes[0].attributes.photo_big;
            _root.mc_desc.descrizione.text = this.childNodes[0].attributes.descrizione;
            _root["mc"+(i+1)].onRelease = released;
            _root["mc"+(i+1)].onRollOver = rollover;
            _root["mc"+(i+1)].onRollOut = rollout;
            _root["mc"+(i+1)].onReleaseOutside = rollout;
         }
         letto = true;
      } else {
         _root.didascalia.text = "errore di lettura";
      }
   };
};
leggi();

_root.onMouseMove = function() {
   y = _root._xmouse;
   x = _root._ymouse;
   if (y>pos_iniziale) {
      if (x>0 && x<60) {
         vel = -(Math.round((x-(larghezzamovie/2))/10));

      }
      if (x>260 && x<larghezzamovie) {
         vel = -(Math.round((x-(larghezzamovie/2))/10));

      }
   } else {
      if (vel>-1) {
         vel = 3;
      } else {
         vel = -3;
      }
   }

};
function released() {

   _root.image = this.big;
   _root.box.play();
   _root.box.clip_mc.loadMovie(_root.image);
   _root.mc_desc.descrizione.text = this.desc;
   //_root.selezione._y = (larghezzamovie)/2;
   //_root.didascalia.text = this.etichetta.text;

   //getURL(percorso,"_blank")
}

function rollover() {
   this._alpha = 100;


}


function rollout() {
   this._alpha = 50;

}

_root.onEnterFrame = function() {
   if (letto) {
      for (i=1; i<=nfoto; i++) {
         _root["mc"+i]._x += vel;
      }
      if (vel>0 && _root["mc"+posSin]._x>0) {
         _root["mc"+posDes]._x = _root["mc"+posSin]._x-dimImm;
         posSin = posDes;
         posDes--;
         if (posDes == 0) {
            posDes = nfoto;
         }
      }
      if (vel<0 && _root["mc"+posSin]._x<=-dimImm) {
         _root["mc"+posSin]._x = _root["mc"+posDes]._x+dimImm;
         posDes = posSin;
         posSin++;
         if (posSin>nfoto) {
            posSin = 1;
         }
      }
   }
};

Por lobo-david

Claber

167 de clabLevel



 

Puerta del Sol, Madrid

safari
Citar            
MensajeEscrito el 08 Sep 2008 07:33 pm
Porfavor ayudarme un poco

Por lobo-david

Claber

167 de clabLevel



 

Puerta del Sol, Madrid

safari
Citar            
MensajeEscrito el 08 Sep 2008 09:15 pm
Tanías la "x" intercambiada con la "y":

Código ActionScript :

_root.onMouseMove = function() {
   x = _root._xmouse;
   y = _root._ymouse;
   
   if (x > pos_iniziale) {
      
      if (x > 0 && x < 60) {
         vel = -(Math.round((x-(larghezzamovie/2))/10));

      }
      if (x>260 && x<larghezzamovie) {
         vel = -(Math.round((x-(larghezzamovie/2))/10));

      }
   } else {
      if (vel>-1) {
         vel = 3;
      } else {
         vel = -3;
      }
   }

};

Por elchininet

Claber

3921 de clabLevel

17 tutoriales

Genero:Masculino  

Front-end developer at Booking.com

firefox
Citar            
MensajeEscrito el 09 Sep 2008 08:59 am
Cuando me dijiste lo del fallo, no me funcionaba nada y no podia moverlo, despues de pensarlo un poco maximice en flash y me situe por debajo, y entonces respondia, solo tube que hacer un poco mas grande la pelicula y colocar las mini fotos más abajo.

Tio te debo una, no se como te lo agradecertelo, muchas gracias!!!

Puedes ver el resultado aquí.

Esta un poco grande pero ya lo solucionare xD.

Un saludo

Por lobo-david

Claber

167 de clabLevel



 

Puerta del Sol, Madrid

safari
Citar            
MensajeEscrito el 10 Sep 2008 08:58 pm
Me parece que el problema de las imágenes más abajo lo podías haber resuelto cambiando

Código ActionScript :

larghezzamovie = Stage.height;


Por

Código ActionScript :

larghezzamovie = Stage.width;

Por elchininet

Claber

3921 de clabLevel

17 tutoriales

Genero:Masculino  

Front-end developer at Booking.com

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.