|
|
 Flash 8
bt1.onRollOver = function() {
gotoAndStop("img1");
};
bt1.onRollOut = function() {
play();
};
bt2.onRollOver = function() {
gotoAndStop("img2");
};
bt2.onRollOut = function() {
play();
};
bt3.onRollOver = function() {
gotoAndStop("img3");
};
bt3.onRollOut = function() {
play();
};
bt4.onRollOver = function() {
gotoAndStop("img4");
};
bt4.onRollOut = function() {
play();
};
|
|
|
|
///On arrete l’animation
stop();
///On charge les classes qui permettent de faire l’animation
import mx.transitions.Tween;
import mx.transitions.easing.*;
//////On charge les clips
mc.attachMovie("clip1", "newclip1", mc.getNextHighestDepth());
mc.attachMovie("clip2", "newclip2", mc.getNextHighestDepth());
mc.attachMovie("clip3", "newclip3", mc.getNextHighestDepth());
mc.attachMovie("clip4", "newclip4", mc.getNextHighestDepth());
//////////////////
///Initialisation
n = 0;
max = 4;
mc.newclip1._alpha = 0;
mc.newclip2._alpha = 0;
mc.newclip3._alpha = 0;
mc.newclip4._alpha = 0;
//////////////
////Animation
function animation() {
var Anim:Tween = new Tween(mc.newclip1, ‘_alpha’, Strong.easeOut, mc.newclip1._alpha, statut[1], 2, true);
var Anim:Tween = new Tween(mc.newclip2, ‘_alpha’, Strong.easeOut, mc.newclip2._alpha, statut[2], 2, true);
var Anim:Tween = new Tween(mc.newclip3, ‘_alpha’, Strong.easeOut, mc.newclip3._alpha, statut[3], 2, true);
var Anim:Tween = new Tween(mc.newclip4, ‘_alpha’, Strong.easeOut, mc.newclip4._alpha, statut[4], 2, true);
}
//////Statut des transparence(alpha) des images et lancement de l’animation
var statut:Array = new Array();
function image() {
if (n == max+1) {
n = 1;
}
if (n == 0) {
n = max;
}
statut[1] = 0;
statut[2] = 0;
statut[3] = 0;
statut[4] = 0;
statut[n] = 100;
animation();
frame = n+1;
gotoAndStop(frame);
}
//////Action des Boutons
bt1.onRollOver = function() {
n = 1;
image();
};
bt2.onRollOver = function() {
n = 2;
image();
};
bt3.onRollOver = function() {
n = 3;
image();
};
bt4.onRollOver = function() {
n = 4;
image();
};
bt_droite.onPress = function() {
n++;
image();
};
bt_gauche.onPress = function() {
n–;
image();
};
|
|
|
|
|
|
 Flash 8
import mx.transitions.Tween;
import mx.transitions.easing.*;
distribution();
function distribution() {
//definition des valeurs des abscisses des clips
x1 = Math.random()*260;
x2 = Math.random()*260;
x3 = Math.random()*260;
x4 = Math.random()*260;
x5 = Math.random()*260;
x6 = Math.random()*260;
x7 = Math.random()*260;
//definition des valeurs des ordonnées des clips
y1 = Math.random()*150;
y2 = Math.random()*150;
y3 = Math.random()*150;
y4 = Math.random()*150;
y5 = Math.random()*150;
y6 = Math.random()*150;
y7 = Math.random()*150;
//definition des valeurs des proportions des clips
proportion1 = Math.random()*50+50;
proportion2 = Math.random()*50+50;
proportion3 = Math.random()*50+50;
proportion4 = Math.random()*50+50;
proportion5 = Math.random()*50+50;
proportion6 = Math.random()*50+50;
proportion7 = Math.random()*50+50;
//definition des valeurs de rotations des clips
rotation1 = Math.random()*360-180;
rotation2 = Math.random()*360-180;
rotation3 = Math.random()*360-180;
rotation4 = Math.random()*360-180;
rotation5 = Math.random()*360-180;
rotation6 = Math.random()*360-180;
var Anim:Tween = new Tween(clip1, ‘_x’, Strong.easeOut, 130, x1, 1, true);
var Anim:Tween = new Tween(clip1, ‘_y’, Strong.easeOut, 80, y1, 1, true);
var Anim:Tween = new Tween(clip1, ‘_rotation’, Strong.easeOut, 0, rotation1, 1, true);
var Anim:Tween = new Tween(clip1, ‘_xscale’, Strong.easeOut, 0, proportion1, 1, true);
var Anim:Tween = new Tween(clip1, ‘_yscale’, Strong.easeOut, 0, proportion1, 1, true);
var Anim:Tween = new Tween(clip2, ‘_x’, Strong.easeOut, 130, x2, 1, true);
var Anim:Tween = new Tween(clip2, ‘_y’, Strong.easeOut, 80, y2, 1, true);
var Anim:Tween = new Tween(clip2, ‘_rotation’, Strong.easeOut, 0, rotation2, 1, true);
var Anim:Tween = new Tween(clip2, ‘_xscale’, Strong.easeOut, 0, proportion2, 1, true);
var Anim:Tween = new Tween(clip2, ‘_yscale’, Strong.easeOut, 0, proportion2, 1, true);
var Anim:Tween = new Tween(clip3, ‘_x’, Strong.easeOut, 130, x3, 1, true);
var Anim:Tween = new Tween(clip3, ‘_y’, Strong.easeOut, 80, y3, 1, true);
var Anim:Tween = new Tween(clip3, ‘_rotation’, Strong.easeOut, 0, rotation3, 1, true);
var Anim:Tween = new Tween(clip3, ‘_xscale’, Strong.easeOut, 0, proportion3, 1, true);
var Anim:Tween = new Tween(clip3, ‘_yscale’, Strong.easeOut, 0, proportion3, 1, true);
var Anim:Tween = new Tween(clip4, ‘_x’, Strong.easeOut, 130, x4, 1, true);
var Anim:Tween = new Tween(clip4, ‘_y’, Strong.easeOut, 80, y4, 1, true);
var Anim:Tween = new Tween(clip4, ‘_rotation’, Strong.easeOut, 0, rotation4, 1, true);
var Anim:Tween = new Tween(clip4, ‘_xscale’, Strong.easeOut, 0, proportion4, 1, true);
var Anim:Tween = new Tween(clip4, ‘_yscale’, Strong.easeOut, 0, proportion4, 1, true);
var Anim:Tween = new Tween(clip5, ‘_x’, Strong.easeOut, 130, x5, 1, true);
var Anim:Tween = new Tween(clip5, ‘_y’, Strong.easeOut, 80, y5, 1, true);
var Anim:Tween = new Tween(clip5, ‘_rotation’, Strong.easeOut, 0, rotation5, 1, true);
var Anim:Tween = new Tween(clip5, ‘_xscale’, Strong.easeOut, 0, proportion5, 1, true);
var Anim:Tween = new Tween(clip5, ‘_yscale’, Strong.easeOut, 0, proportion5, 1, true);
var Anim:Tween = new Tween(clip6, ‘_x’, Strong.easeOut, 130, x6, 1, true);
var Anim:Tween = new Tween(clip6, ‘_y’, Strong.easeOut, 80, y6, 1, true);
var Anim:Tween = new Tween(clip6, ‘_rotation’, Strong.easeOut, 0, rotation6, 1, true);
var Anim:Tween = new Tween(clip6, ‘_xscale’, Strong.easeOut, 0, proportion6, 1, true);
var Anim:Tween = new Tween(clip6, ‘_yscale’, Strong.easeOut, 0, proportion6, 1, true);
var Anim:Tween = new Tween(clip7, ‘_x’, Strong.easeOut, 130, x7, 1, true);
var Anim:Tween = new Tween(clip7, ‘_y’, Strong.easeOut, 80, y7, 1, true);
var Anim:Tween = new Tween(clip7, ‘_rotation’, Strong.easeOut, 0, rotation7, 1, true);
var Anim:Tween = new Tween(clip7, ‘_xscale’, Strong.easeOut, 0, proportion7, 1, true);
var Anim:Tween = new Tween(clip7, ‘_yscale’, Strong.easeOut, 0, proportion7, 1, true);
}
btn.onPress = function() {
distribution();
}; };
|
|
|
Merci pour ces diverses facons de faire un slideshow.