Salut,
je suis débutant en Flash et je souhaite réaliser une diapo.
J'ai trouver un script dont j'ai modifié le code ça marche pas pourqoui?
voici le code :
<table border="0" cellpadding="0" cellspacing="0" summary="">
<tr><td>
<img
src="http://localhost/clarissime/html/CLA001.jpg"
width="429"
height="652"
border="1">
<embed
flashvars="adress=http://localhost/clarissime/html/
&picture=CLA001.jpg|CLA002.jpg|CLA004.jpg|CLA005.jpg"
tempo="4000"
width="429"
height="652"
src="http://localhost/clarissime/html/loader_diapos.swf"
bgcolor="#FFFFFF" type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer">
</embed>
</td></tr>
</table>
fichier loader_diapos.swf
_global.SW = Stage.width;
_global.SH = Stage.height;
_global.SWsur2 = SW / 2;
_global.SHsur2 = SH / 2;
_quality = "BEST";
Stage.scaleMode = "exactFit";
//-----------------------------------------------
MovieClip.prototype.chargement_jpg = function(jpg) {
clearInterval(ID_remplir);
this.dest.loadMovie(jpg);
var id = setInterval(function (mc) {
var d = mc["dest"];
if (d._width > 0) {
clearInterval(id);
d.proportion = (d._width / d._height);
if (d.proportion >= 1) {
d._width = SW * .95;
d._height = d._width / d.proportion;
if (d._height > SH * .92) {
delta = SH * .92 / d._height;
d._width *= delta;
d._height *= delta;
}
} else {
d._height = SH * .92;
d._width = d._height * d.proportion;
if (d._width > SW * .95) {
delta = SW * .95 / d._width;
d._width *= delta;
d._height *= delta;
}
}
LA[mc._numero] = d._width;
HA[mc._numero] = d._height;
// --------------------
mc.charge = true;
// --------------------
var bt = _root.fond_repere.createEmptyMovieClip("bt" + nbre_charge, nbre_charge);
with (bt) {
lineStyle(6, 0x000000);
moveTo(0, SH - 4);
lineTo(Math.floor(SW / NB_photos / 1.5), SH - 4);
lineStyle(3, 0xee3300);
lineTo(0, SH - 4);
_alpha = 15;
position_bt += Math.floor(SW / NB_photos);
_x = position_bt - Math.floor(SW / NB_photos / 2);
}
bt._numero = nbre_charge;
bt.onPress = function() {
this._alpha = 100;
pt_photo = Number(this._numero);
clearInterval(_global.ID_afficher);
_global.ID_afficher = setInterval(afficher, _global.vitesse);
afficher();
};
bt.onRollOver = function() {
this._alph = this._alpha;
this._alpha = 35;
this._y = 2;
};
bt.onRollOut = function() {
this._alpha = this._alph;
this._y = 0;
};
// --------------------
nbre_charge++;
if (nbre_charge >= NB_photos) {
_root.clear();
}
if (nbre_charge == 1) {
afficher();
}
ID_remplir = setInterval(remplir, 50);
// --------------------
} else {
if (d.getBytesTotal() > 10) {
var pourcent = Math.round(10 + (d.getBytesLoaded() / d.getBytesTotal()) * 45);
with (_root) {
lineStyle(4, 0x663300);
moveTo(10, 5);
lineTo(60, 5);
lineStyle(3, 0xffddbb);
moveTo(10, 5);
lineTo(pourcent, 5);
}
}
}
}, 50, this);
};
//-----------------------------------------------
MovieClip.prototype.deformer = function(ancien, nouveau) {
var x_deb = LA[ancien._numero] / 2;
var y_deb = HA[ancien._numero] / 2;
var x_fin = LA[nouveau._numero] / 2;
var y_fin = HA[nouveau._numero] / 2;
var dis_x = (x_fin - x_deb) / 2;
var dis_y = (y_fin - y_deb) / 2;
// -----------------------
duree = 12;
var vites = Math.PI / duree;
var angle = -Math.PI;
var limite = -Math.PI / 3.3;
var decalage = Math.PI / 12;
_quality = "LOW";
this.onEnterFrame = function() {
angle += vites;
s = 1 + Math.cos(angle - Math.sin(angle - decalage));
// -----------------------
var dx = x_deb + s * dis_x;
var dy = y_deb + s * dis_y;
nouveau._width = ancien._width = 2 * dx;
ancien._height = nouveau._height = 2 * dy;
ancien._x = nouveau._x = SWsur2 - dx;
ancien._y = nouveau._y = SHsur2 - dy;
// -----------------------
this.clear();
this.beginFill(0x332211, 100);
this.lineStyle(6, 0x444444, 100);
this.moveTo(SWsur2 + dx, SHsur2 - dy);
this.lineTo(SWsur2 + dx, SHsur2 + dy);
this.lineTo(SWsur2 - dx, SHsur2 + dy);
this.lineStyle(6, 0xaaaaaa, 100);
this.lineTo(SWsur2 - dx, SHsur2 - dy);
this.lineTo(SWsur2 + dx, SHsur2 - dy);
this.endFill();
// -----------------------
if (ancien._alpha > 20) {
ancien._alpha /= 1.5;
nouveau._visible = false;
nouveau._alpha = 20;
} else {
ancien._visible = false;
nouveau._visible = true;
nouveau._alpha *= 1.5;
}
// -----------------------
//ancien._alpha -= 8;
if (angle >= limite) {
_quality = "BEST";
ancien._alpha = 0;
nouveau._visible = true;
nouveau._alpha = 100;
delete this.onEnterFrame;
}
};
};
// ----------------------------------------------
afficher = function () {
if (pt_photo >= NB_photos) {
pt_photo = 0;
}
_root.fond_repere["bt" + pt_photo_precedent]._alpha = 15;
_root.fond_repere["bt" + pt_photo]._alpha = 100;
_root.fond_photo.deformer(clips[pt_photo_precedent], clips[pt_photo]);
clips[pt_photo_precedent].swapDepths(niveau++);
clips[pt_photo].swapDepths(niveau);
pt_photo_precedent = pt_photo;
pt_photo++;
};
// ------------------------------------------------
remplir = function () {
if (pt_remplir < NB_photos) {
var d = clips[pt_remplir].createEmptyMovieClip("dest", i + 200);
d.onLoad = function() {
// var ladress = fichier[pt_remplir] + "?" + random(99999);
var ladress = fichier[pt_remplir];
this._parent.chargement_jpg(ladress);
};
d.onLoad();
} else {
clearInterval(ID_remplir);
}
pt_remplir++;
};
//-----------------------------------------------
_global.niveau = 10000;
_global.fichier = [];
_global.LA = [];
_global.HA = [];
_global.clips = [];
_global.pt_remplir = 0;
_global.pt_photo = 0;
_global.pt_photo_precedent = 0;
_global.nbre_charge = 0;
_global.position_bt = 0;
//----------------------------------------------
if ("-" + adress + "-" != "--") {
_global.repertoire = adress;
} else {
_global.repertoire = "http://localhost/clarissime/html/";
}
//------------------------------
if ("-" + tempo + "-" != "--") {
_global.vitesse = Number(tempo);
} else {
_global.vitesse = 4000;
}
//------------------------------
if ("-" + picture + "-" != "--") {
fichier = picture.split("|");
} else {
_global.picture = "CLA001.jpg|CLA002.jpg|CLA004.jpg|CLA005.jpg";
fichier = picture.split("|");
}
//----------------------------------------------
_global.NB_photos = fichier.length;
//----------------------------------------------
for (var i = 0; i < NB_photos; i++) {
fichier[i] = repertoire + fichier[i];
}
//----------------------------------------------
_root.createEmptyMovieClip("phototheque", -2);
phototheque.onLoad = function() {
for (var i = 0; i < NB_photos; i++) {
clips[i] = _root.createEmptyMovieClip("cadre" + i, i - 350);
clips[i]._numero = i;
clips[i]._alpha = 0;
clips[i]._visible = true;
}
_global.ID_remplir = setInterval(remplir, 50);
};
phototheque.onLoad();
//-----------------------------------------------
_root.createEmptyMovieClip("fond_photo", -10);
_root.createEmptyMovieClip("fond_repere", -11);
//----------------------------------------------
_global.ID_afficher = setInterval(afficher, _global.vitesse);
stop();
//-----------------------------------------------