|
|
 Flash 8
import mx.transitions.Tween;
import mx.transitions.easing.*;
durée = 300;
max = 6;
num = 0;
initialisation();
loading();
function initialisation() {
num++;
nn = 0;
statutLoad = 1;
statutTimer = 1;
}
function loading() {
Oldclip = myclip;
if (num == max) {
num = 1;
}
this.createEmptyMovieClip("clip"+num,this.getNextHighestDepth());
eval("clip"+num)._alpha = 0;
eval("clip"+num).loadMovie("http://www.ateliernumerique.com/images/img"+num+".gif");
myclip = eval("clip"+num);
this.onEnterFrame = fondu;
}
function fondu() {
nn++;
pourcentage = myclip.getBytesLoaded()/myclip.getBytesTotal()*100;
if (pourcentage == 100) {
statutLoad = 1;
}
if (nn>durée) {
statutTimer = 1; }
if (statutTimer == 1 && statutLoad == 1 && myclip._width>0) {
delete this.onEnterFrame;
change_image();
}
}
function change_image() {
myclip._x = (Stage.width-myclip._width)/2;
myclip._y = (Stage.height-myclip._height)/2;
var MonAnim:Tween = new Tween(myclip, '_alpha', Strong.easeOut, myclip._alpha, 100, 2, true);
var MonAnim:Tween = new Tween(Oldclip, '_alpha', Strong.easeOut, Oldclip._alpha, 0, 2, true);
MonAnim.onMotionFinished = function() {
Oldclip.removeMovieClip();
initialisation();
loading();
};
}
|
|
|
|
|
 Flash 8
import mx.transitions.Tween;
import mx.transitions.easing.*;
durée = 100;
max = 4;
num = 1;
nn = 0;
statutLoad = 1;
statutTimer = 1;
loading();
function loading() {
if (num == max+1) {
num = 1;
}
this.createEmptyMovieClip("clip"+num,this.getNextHighestDepth());
eval("clip"+num).loadMovie("http://www.ateliernumerique.com/images/img"+num+".gif");
eval("clip"+num)._x = Stage.width;
Oldclip = myclip;
myclip = eval("clip"+num);
this.onEnterFrame = fondu; }
function fondu() {
nn++;
pourcentage = myclip.getBytesLoaded()/myclip.getBytesTotal()*100;
if (pourcentage == 100) {
statutLoad = 1;
}
if (nn>durée) {
statutTimer = 1;
}
if (statutTimer == 1 && statutLoad == 1) {
delete this.onEnterFrame;
num++;
Moving();
nn = 0;
}
}
function Moving() {
var MonAnim:Tween = new Tween(myclip, '_x', Strong.easeOut, myclip._x, 0, 2, true);
var MonAnim:Tween = new Tween(Oldclip, '_x', Strong.easeOut, Oldclip._x, -Stage.width, 2, true);
statutTimer = 0;
statutLoad = 0;
loading();
}
|
|
|
bonjour, comment paramétrer le temps d’affichage des photo svp – la fonction ‘durée’ ne marche pas …merci mille fois de votre réponse et merci pour la source – dommage si on peux pas paramétrer …sauvez moi !!! 3 jours là dessus suis nulllllllllllll
en fait il suffit de mettre statutLoad = 0; à la 3eme ligne avant la fin – après loading..
et voilà