Bueno, ahora mi web está evolucionando (lo podreis notar por las cientos de preguntas que hago aquí) y trabrajo con cs3.
El caso es que no me funciona la fototeca en cs3 y me gustaría a ver si alguno me ayudais a pasarla o me comentais algunas que sea parecida y esté bien.
Es totalmente dinámica, así que copiando el codigo en un proyecto flash nuevo podréis ver como es.
Las que veo por ahí no me valen porque yo uso, por así decirlo, carpetas y tengo 5 o 6 carpetas de 23 fotos y el usuario selecciona cual quiere ver y en xml no se seleccionar, pudiendo hacer un if en xml o pasarle la dirección de la carpeta desde flash lo tendría solucionado, pero como no se hacerlo...
Bueno, aquí teneis el código.
Código :
_global.SW = 550;
_global.SH = 400;
_global.SWsur2 = SW/2;
_global.SHsur2 = SH/2;
Stage.scaleMode = "exactFit";
//----------------------------------------------
MovieClip.prototype.rectangle_arrondi_ombre = function(larg, haut, rayon, epais, couleur, transp) {
var mc = this.createEmptyMovieClip("rectangle_arrondi", 10000);
mc.onLoad = function() {
with (this) {
for (var i = 6; i>0; i -= .5) {
lineStyle(2*i,0x000000,40-i*6);
moveTo(larg+i,rayon*.7+5*i);
lineTo(larg+i,haut-rayon+2*i);
curveTo(larg,haut,larg-rayon+2*i,haut+i);
lineTo(rayon*.7+5*i,haut+i);
}
moveTo(rayon,0);
//-------------------
lineStyle(epais,0x000000,100);
beginFill(couleur,transp);
moveTo(rayon,0);
lineTo(larg-rayon,0);
curveTo(larg,0,larg,rayon);
lineTo(larg,haut-rayon);
curveTo(larg,haut,larg-rayon,haut);
lineTo(rayon,haut);
curveTo(0,haut,0,haut-rayon);
lineTo(0,rayon);
curveTo(0,0,rayon,0);
endFill();
}
};
mc.onLoad();
};
//----------------------------------------------
this.createEmptyMovieClip("cadre",-1111);
cadre._x = 2;
cadre._y = 2;
cadre.rectangle_arrondi_ombre(SW-4,SH-4,SW/20,2,0x996633,10);
//----------------------------------------------
MovieClip.prototype.chargement_jpg = function(jpg, couleur, larg, haut) {
var cible = this.dest;
cible._alpha = 0;
cible.loadMovie(jpg);
var id = setInterval(function (mc) {
var d = mc["dest"];
if (d._width>0) {
clearInterval(id);
d.memw = d._width;
d.memh = d._height;
d.proportion = (d._width/d._height);
d._width = Math.floor(mc._w0*2);
d._height = Math.floor(mc._h0*2);
d._alpha = 99;
with (d) {
lineStyle(4,0x444444,80);
moveTo(this._x+memw+1,this._y-1);
lineTo(this._x+memw+1,this._y+memh+1);
lineTo(this._x-1,this._y+memh+1);
lineStyle(4,0xaaaaaa,80);
lineTo(this._x-1,this._y-1);
lineTo(this._x+memw+1,this._y-1);
}
// --------------------
mc._alpha = 99;
mc._width = mc._w0;
mc._height = mc._h0*1.5;
mc.onPress = cliquer;
// mc.onRelease = relacher;
// mc.onReleaseOutside = relacher;
//--------------------
} else {
var pourcent = (d.getBytesLoaded()/d.getBytesTotal());
mc._width = pourcent*mc._w0;
mc._height = pourcent*mc._h0*1.6;
}
}, 100, this);
};
// -----------------------------------------------------
MovieClip.prototype.cliquer = function() {
_global.memoire.swapDepths(0);
_global.memoire.relacher();
if (_global.memoire != this) {
_global.memoire = this;
//---------------------
delete this.onEnterFrame;
//---------------------
var grossissement_V = SH*.9;
var grossissement_H = grossissement_V*this.dest.proportion;
var positiont_V = SHsur2*1.1;
//---------------------
this._alpha = 99;
this.swapDepths(this.niveau++);
//---------------------
var x_deb = this._x;
var y_deb = this._y;
var dis_x = (SWsur2-x_deb)/2;
var dis_y = (positiont_V-y_deb)/2;
var vitesse = Math.PI/20;
var angle = -Math.PI;
var limite = -Math.PI/3.3;
var decalage = Math.PI/6;
//------------------------------------
this.onEnterFrame = function() {
angle += vitesse;
s = 1+Math.cos(angle-Math.sin(angle-decalage));
this._x = x_deb+s*dis_x;
this._y = y_deb+s*dis_y;
this._width += (grossissement_H-this._width)/5;
this._height += (grossissement_V-this._height)/3;
//---------------------
if (angle>=limite) {
this._width = grossissement_H;
this._height = grossissement_V;
delete this.onEnterFrame;
}
};
}
};
// -----------------------------------------------------
MovieClip.prototype.relacher = function() {
delete this.onEnterFrame;
this.onEnterFrame = function() {
this._width += (this._w0-this._width)/4;
this._height += (this._h0-this._height)/4;
this._x += (this._x0-this._x)/4;
this._y += (this._y0-this._y)/4;
if (this._yscale<70) {
this._width = this._w0;
this._height = this._h0*1.5;
this._x = this._x0;
this._y = this._y0;
this._alpha = 50;
delete this.onEnterFrame;
}
};
};
// -----------------------------------------------------
MovieClip.prototype.allons_y = function(tableau) {
var L = SW/(tableau.length+2);
L = Math.floor(L*.9);
var M = L+5;
for (var i = 0; i<tableau.length; i++) {
clip = this.createEmptyMovieClip("cadre"+i, i);
clip.onLoad = function() {
//--------------------
this._alpha = 30;
this.lineStyle(4,0,20);
this.moveTo(-(L+2),L);
this.lineTo(M,L);
this.lineTo(M,-(L-3));
// --------------------
this.moveTo(M,-L);
this.lineStyle(0,0x999999);
this.beginFill(0xfff6f0,100);
this.lineTo(-M,-L);
this.lineTo(-M,L);
this.lineStyle(0,0);
this.lineTo(M,L);
this.lineTo(M,-L);
this.endFill();
//--------------------
this._x0 = (1.2*(i+1))*L;
this._y0 = L;
this._x = this._x0;
this._y = this._y0;
//--------------------
this._w0 = L+3;
this._h0 = L-5+3;
this._width = this._w0;
this._height = this._h0;
//--------------------
this.createEmptyMovieClip("dest",i+200);
//--------------------
this.dest.onLoad = function() {
this._x = -L-3;
this._y = -L+2;
var ladress = tableau[i]+"?"+random(99999);
var ladress = tableau[i];
this._parent.chargement_jpg(ladress,0xff8800,20,50);
};
this.dest.onLoad();
};
clip.onLoad();
}
};
//------------------------------------------------------
niveau = 10000;
//------------------------------------------------------
_global.fichier = [];
_global.repertoire = "http://url_de_las_carpetas";
//Asignamos la carpeta concreta
if (_root.num_fototeca==1) {
_global.carpeta = "a1";
} else if (_root.num_fototeca==2) {
_global.carpeta = "a2";
} else if (_root.num_fototeca==3) {
_global.carpeta = "a3";
} else if (_root.num_fototeca==4) {
_global.carpeta = "a4";
} else if (_root.num_fototeca==5) {
_global.carpeta = "a5";
} else if (_root.num_fototeca==6) {
_global.carpeta = "a6";
} else if (_root.num_fototeca==7) {
_global.carpeta = "a7";
}
_global.carpeta = _global.carpeta + "/";
//------------------------------------------------------
fichier[0] = "1";
fichier[1] = "2";
fichier[2] = "3";
fichier[3] = "4";
fichier[4] = "5";
fichier[5] = "6";
fichier[6] = "7";
fichier[7] = "8";
fichier[8] = "9";
fichier[9] = "10";
fichier[10] = "11";
fichier[11] = "12";
fichier[12] = "13";
fichier[13] = "14";
fichier[14] = "15";
fichier[15] = "16";
fichier[16] = "17";
fichier[17] = "18";
fichier[18] = "19";
fichier[19] = "20";
fichier[20] = "21";
fichier[21] = "22";
fichier[22] = "23";
/**/
for (var i = 0; i<fichier.length; i++) {
fichier[i] = repertoire+carpeta+fichier[i]+".JPG";
//trace(fichier[i]);
}
this.createEmptyMovieClip("phototheque",0);
phototheque.allons_y(fichier);
//------------------------------------------------------
stop();
//------------------------------------------------------Espero que podais ayudarme de alguna manera, gracias
