Bonjour,
Voila je rencontre un petit probleme pour mon site, je cherche à inserer un fichier swf dans un autre. je m'explique, sur mon site on a pls boutons, dont un qui doit enclencher un diaporama. Le tout est en flash.
Seulement indépendament, ce diapo marche tres bien, mais lorske je l'insere dans mon site (aussi en flash) bah....ça marche pas!
Voici le code du diaporama : (il n'est pas de moi, j'ai dû me prendre sur flashkod d'ailleurs)
On dirait qu'il le lit, mais de derriere, ça fait bouger mon site en flash (a cause du chargement) mais le diapo ne s'affiche pas. J'ai bien essayé de le mettre sur le meme site, mais ça fait pareil. Je ne suis pas très doué en flash, alors forcement, là ça blok!
Merci de me tirer de ce mauvais pas, je galere pas mal!
_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);
// trace(mc)
d.proportion = (d._width / d._height);
// d._height = SH * .93;
// d._width = d._height * d.proportion;
if (d.proportion >= 1) {
d._width = SW * .95;
d._height = d._width / d.proportion;
if (d._height > SH * .95) {
delta = SH * .95 / d._height;
d._width *= delta;
d._height *= delta;
}
} else {
d._height = SH * .95;
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;
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);
_root.lineStyle(4, 0x663300);
_root.moveTo(10, 5);
_root.lineTo(60, 5);
_root.lineStyle(3, 0xffddbb);
_root.moveTo(10, 5);
_root.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 vitesse = Math.PI / duree;
var angle = -Math.PI;
var limite = -Math.PI / 3.3;
var decalage = Math.PI / 12;
_quality = "LOW";
this.onEnterFrame = function() {
angle += vitesse;
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;
// trace(x_deb + " " + 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_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.repertoire = "c:/diapo/";
//------------------------------------------------------
_global.picture = "01.jpg|02.jpg|03.jpg|04.jpg|05.jpg|06.jpg|07.jpg|08.jpg|09.jpg|10.jpg|11.jpg";
picture += "|p06.jpg|p07.jpg|p08.jpg|d01.jpg|p09.jpg|p11.jpg|d05.jpg|p12.jpg|p13.jpg|p14.jpg|p15.jpg|p16.jpg|p17.jpg";
fichier = picture.split("|");
/**/
//----------------------------------------------
_global.NB_photos = fichier.length;
//----------------------------------------------
for (var i = 0; i < NB_photos; i++) {
fichier[i] = repertoire + fichier[i];
}
//----------------------------------------------
_root.createEmptyMovieClip("fond_photo", -10);
//----------------------------------------------
_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();
setInterval(afficher, 4000);
stop();
//------------------------------------------------------
