Instance of Symbol 17 MovieClip in Frame 1
//component parameters
onClipEvent (initialize) {
txtfont = "Arial";
txtcolor = 0;
txtbold = true;
txtitalic = true;
txtsize = 12;
barcolor = 16711680 /* 0xFF0000 */;
txtstyle = "Kilobytes";
}
Frame 2
stop();
_focusrect = false;
fscommand ("allowscale", false);
fscommand ("fullscreen", false);
nbrDePastilles = 5;
precision = 4;
zones = new Array();
positions = new Array();
coord = new Array();
tester = function () {
var _local1 = 0;
test1 = true;
test2 = true;
i = 1;
while (i <= nbrDePastilles) {
if (zones[i] == 0) {
test2 = false;
break;
}
i++;
}
i = 1;
while (i <= nbrDePastilles) {
if (zones[i] != i) {
test1 = false;
_local1++;
}
i++;
}
if (test2 == false) {
texte = "Il faut placer tous les chiffres !";
} else if (test1 == true) {
texte = "Bravo, c'est gagn\u00E9 !";
} else {
texte = ("Dommage, c'est rat\u00E9 ! Il y a " + _local1) + " erreurs.";
}
};
recommencer = function () {
i = 1;
while (i <= nbrDePastilles) {
eval ("pastille" + i)._x = positions[i][0];
eval ("pastille" + i)._y = positions[i][1];
i++;
}
initialisation();
};
memorisationDesPositions = function () {
var x;
var y;
i = 1;
while (i <= nbrDePastilles) {
x = eval ("pastille" + i)._x;
y = eval ("pastille" + i)._y;
positions[i] = [x, y];
i++;
}
};
initialisation = function () {
texte = "";
i = 0;
while (i <= nbrDePastilles) {
zones[i] = 0;
i++;
}
};
numeroDesPastilles = function () {
i = 1;
while (i <= nbrDePastilles) {
eval ("pastille" + i).chiffre = i;
i++;
}
};
initialisation();
memorisationDesPositions();
numeroDesPastilles();
Instance of Symbol 8 MovieClip [pastille] "pastille1" in Frame 2
//component parameters
onClipEvent (initialize) {
nombre = 1;
}
Instance of Symbol 8 MovieClip [pastille] "pastille2" in Frame 2
//component parameters
onClipEvent (initialize) {
nombre = 2;
}
Instance of Symbol 8 MovieClip [pastille] "pastille3" in Frame 2
//component parameters
onClipEvent (initialize) {
nombre = 3;
}
Instance of Symbol 8 MovieClip [pastille] "pastille4" in Frame 2
//component parameters
onClipEvent (initialize) {
nombre = 4;
}
Instance of Symbol 8 MovieClip [pastille] "pastille5" in Frame 2
//component parameters
onClipEvent (initialize) {
nombre = 5;
}
Symbol 7 Button
on (press) {
_root.texte = "";
this.startDrag(false);
this.swapDepths(1);
i = 1;
while (i <= _root.nbrDePastilles) {
if (_root.zones[i] == nombre) {
_root.zones[i] = 0;
}
i++;
}
}
on (release, releaseOutside) {
stopDrag();
test1 = 1;
i = 1;
while (i <= _root.nbrDePastilles) {
numZone = i;
if (this.hitTest(_root["zone" + i]) == true) {
test1 = 0;
break;
}
i++;
}
if (_root.zones[numZone] == 0) {
test2 = true;
} else {
test2 = false;
}
if ((test1 == 0) & (test2 == true)) {
this._x = _root["zone" + numZone]._x;
this._y = _root["zone" + numZone]._y;
_root.zones[numZone] = nombre;
} else {
this._x = _root.positions[nombre][0];
this._y = _root.positions[nombre][1];
}
}
Symbol 17 MovieClip Frame 1
myformat = new textformat();
myformat.font = txtfont;
myformat.color = txtcolor;
myformat.bold = txtbold;
myformat.italic = txtitalic;
myformat.size = txtsize;
myformat.align = "center";
preloader._visible = false;
if (preloader.percentbytes >= 100) {
_root.play();
}
Symbol 17 MovieClip Frame 2
myColor = new Color(preloader.bar.barcolor);
myColor.setRGB(barcolor);
stop();
Instance of Symbol 16 MovieClip "preloader" in Symbol 17 MovieClip Frame 2
onClipEvent (load) {
_root.stop();
this.createTextField("textbox2", 1, -119.3, -39, 238.7, 78.1);
textbox2.variable = "txtdisplay";
textbox2.selectable = false;
}
onClipEvent (enterFrame) {
currentbytes = int(_root.getBytesLoaded() / 1000);
totalbytes = int(_root.getBytesTotal() / 1000);
percentbytes = int((currentbytes / totalbytes) * 100);
if (_parent.txtstyle == "Kilobytes") {
textbox2.text = ((("Loading " + currentbytes) + " Kb of ") + totalbytes) + " Kb";
textbox2.setTextFormat(_parent.myformat);
bar._xscale = percentbytes;
if (percentbytes >= 100) {
textbox2.text = "Chargement Complet";
textbox2.setTextFormat(_parent.myformat);
_root.play();
}
}
if (_parent.txtstyle == "Pourcent") {
textbox2.text = ("Loading " + percentbytes) + "% ";
textbox2.setTextFormat(_parent.myformat);
bar._xscale = percentbytes;
if (percentbytes >= 100) {
textbox2.text = "Chargement Complet";
textbox2.setTextFormat(_parent.myformat);
_root.play();
}
}
if (_parent.txtstyle == "Both") {
textbox2.text = ((("Loading " + percentbytes) + "% of ") + totalbytes) + " Kb";
textbox2.setTextFormat(_parent.myformat);
bar._xscale = percentbytes;
if (percentbytes >= 100) {
textbox2.text = "Chargement Complet";
textbox2.setTextFormat(_parent.myformat);
_root.play();
}
}
}
Symbol 42 MovieClip Frame 10
stop();
Symbol 48 Button
on (press) {
_root.tester();
}
Symbol 54 Button
on (press) {
_root.recommencer();
}
Symbol 61 MovieClip Frame 7
stop();
Symbol 63 Button
on (press) {
getURL ("http://www.biologieenflash.net/");
}