Voilà pour raphy qui voulait voir mon code, ceci est des heures de patience et d'apprentissage mis à l'épreuve ^^ :
/*--------------------------------------Début du code--------------------------------*/
import fl.motion.MotionEvent;
import flash.events.MouseEvent;
import flash.sampler.NewObjectSample;
import flash.media.Sound;
var mauvaiseR: Sound = new mauvais()
var clickPiece: Sound = new pieceC()
var perdre: Sound = new perdu();
var gagner: Sound = new gagne();
var pieceDep: Sound = new clickk();
var posX: int = 0; //Variable pour se rappeler de la position des pieces
var posY: int = 0; //Variable pour se rappeler de la position des pieces
var point: int = 0; //Variable pour le score
var min: int = 0; //Variable pour les minutes du times
var seconde: int = 0; //Variable pour les secondes du timer
var monTimer: Timer = new Timer(1000) //création du timer
/*-----------------------------------Code pour Instruction--------------------------*/
instruction.visible = false;
ClipJeu.visible = false;
this.ClipJeu.clipGagne.visible = false;
this.ClipJeu.clipPerdu.visible = false;
this.menuP.btnCommencer.addEventListener(MouseEvent.CLICK, commenceJeu)
this.menuP.btnInstruction.addEventListener(MouseEvent.CLICK, montreInstruction)
//fait apparaitre en pop up la fenetre d'instruction
function montreInstruction(e: MouseEvent) {
this.instruction.btnRetour.addEventListener(MouseEvent.CLICK, retour)
instruction.visible = true;
}
//fait disparaitre le pop up et enleve l'ecouteur du btnRetour
function retour(e: MouseEvent) {
instruction.visible = false;
this.instruction.btnRetour.removeEventListener(MouseEvent.CLICK, retour)
}
/*----------------------------------- fin du Code pour Instruction--------------------------*/
function commenceJeu(e: MouseEvent) {
/*----désactive les boutons des autres menu et start le timer-----*/
monTimer.addEventListener(TimerEvent.TIMER, Horloge)
monTimer.start()
ClipJeu.visible = true;
menuP.visible = false;
this.menuP.btnCommencer.removeEventListener(MouseEvent.CLICK, commenceJeu)
this.menuP.btnInstruction.removeEventListener(MouseEvent.CLICK, montreInstruction)
this.ClipJeu.retourMenu.addEventListener(MouseEvent.CLICK, retourMenu)
/*-----------------------------------fin-----------------------*/
/*-----------------------------écouteur pour les pièces-----------------------------------------*/
//mouse down pour pouvoir prendre les pièces
this.ClipJeu.piece23.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece22.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece21.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece20.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece19.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece18.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece17.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece16.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece15.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece14.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece13.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece12.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece11.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece10.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece9.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece8.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece7.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece6.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece5.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece4.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece3.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece2.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece1.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
/*----------------------------------------------------------------------*/
//Mouse up pour déposé les pièces
this.ClipJeu.piece23.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece22.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece21.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece20.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece19.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece18.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece17.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece16.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece15.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece14.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece13.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece12.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece11.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece10.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece9.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece8.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece7.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece6.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece5.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece4.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece3.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece2.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece1.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
/*--------------------------fin écouteur pour pièce--------------------------------------------*/
}
/*sert à faire cliper les pièces avec leur hotSpot*/
this.ClipJeu.piece23.sonHotSpot = this.ClipJeu.hotSpot23;
this.ClipJeu.piece22.sonHotSpot = this.ClipJeu.hotSpot22;
this.ClipJeu.piece21.sonHotSpot = this.ClipJeu.hotSpot21;
this.ClipJeu.piece20.sonHotSpot = this.ClipJeu.hotSpot20;
this.ClipJeu.piece19.sonHotSpot = this.ClipJeu.hotSpot19;
this.ClipJeu.piece18.sonHotSpot = this.ClipJeu.hotSpot18;
this.ClipJeu.piece17.sonHotSpot = this.ClipJeu.hotSpot17;
this.ClipJeu.piece16.sonHotSpot = this.ClipJeu.hotSpot16;
this.ClipJeu.piece15.sonHotSpot = this.ClipJeu.hotSpot15;
this.ClipJeu.piece14.sonHotSpot = this.ClipJeu.hotSpot14;
this.ClipJeu.piece13.sonHotSpot = this.ClipJeu.hotSpot13;
this.ClipJeu.piece12.sonHotSpot = this.ClipJeu.hotSpot12;
this.ClipJeu.piece11.sonHotSpot = this.ClipJeu.hotSpot11;
this.ClipJeu.piece10.sonHotSpot = this.ClipJeu.hotSpot10;
this.ClipJeu.piece9.sonHotSpot = this.ClipJeu.hotSpot9;
this.ClipJeu.piece8.sonHotSpot = this.ClipJeu.hotSpot8;
this.ClipJeu.piece7.sonHotSpot = this.ClipJeu.hotSpot7;
this.ClipJeu.piece6.sonHotSpot = this.ClipJeu.hotSpot6;
this.ClipJeu.piece5.sonHotSpot = this.ClipJeu.hotSpot5;
this.ClipJeu.piece4.sonHotSpot = this.ClipJeu.hotSpot4;
this.ClipJeu.piece3.sonHotSpot = this.ClipJeu.hotSpot3;
this.ClipJeu.piece2.sonHotSpot = this.ClipJeu.hotSpot2;
this.ClipJeu.piece1.sonHotSpot = this.ClipJeu.hotSpot1;
/*-----------------------------fin-------------------*/
/*fonction pour le timer et faire perde le participant si atteint 1.45min*/
function Horloge(pEvt: TimerEvent) {
seconde++
if (seconde == 60) {
min++
seconde = 0
}
if (min == 2 && seconde == 30) {
monTimer.stop()
perdre.play()
this.ClipJeu.clipPerdu.visible=true;
this.ClipJeu.clipPerdu.play()
trace("Perdu")
this.ClipJeu.piece23.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece22.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece21.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece20.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece19.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece18.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece17.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece16.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece15.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece14.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece13.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece12.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece11.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece10.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece9.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece8.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece7.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece6.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece5.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece4.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece3.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece2.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece1.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
}
this.ClipJeu.mcChamp.text = min + ":" + seconde;
}
/*----------------------------------fin de la fonction timer---------------------*/
function bougePiece(e: MouseEvent) {
posX = e.currentTarget.x;
posY = e.currentTarget.y;
e.currentTarget.startDrag();
clickPiece.play()
} //fonction pour prendre une pièce
//fonction pour déposer une pièce
function deposePiece(e: MouseEvent) {
e.currentTarget.stopDrag();
//augment les points de 1 si il clipe avec son hot spot et si atteint 23 point gagné
if (e.currentTarget.hitTestObject(e.currentTarget.sonHotSpot)) {
e.currentTarget.x = e.currentTarget.sonHotSpot.x;
e.currentTarget.y = e.currentTarget.sonHotSpot.y;
e.currentTarget.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
point++
this.ClipJeu.pointage.text = "points:" + point + "/23";
this.ClipJeu.BonhomeS.play()
this.ClipJeu.textes.text = "Bravo!"
pieceDep.play()
} else {
e.currentTarget.x = posX;
e.currentTarget.y = posY;
this.ClipJeu.Bonhome2.play()
this.ClipJeu.textes.text = "Essaye encore!"
mauvaiseR.play()
} //si pas déposé sur le hot spot la pièce retourne à ça place
if (point == 23) {
monTimer.stop()
gagner.play()
trace("gagné")
this.ClipJeu.clipGagne.visible=true;
this.ClipJeu.clipGagne.play()
}
}
//fonction pour retourner au menu
function retourMenu(e: MouseEvent) {
monTimer.reset()
monTimer.stop()
seconde = 0;
min = 0;
point= 0;
this.ClipJeu.pointage.text = "points:" + point + "/23";
//stop et reset le timer
this.ClipJeu.clipGagne.play()
this.ClipJeu.clipGagne.visible = false;
ClipJeu.visible = false;
menuP.visible = true;
this.menuP.btnCommencer.addEventListener(MouseEvent.CLICK, commenceJeu)
this.menuP.btnInstruction.addEventListener(MouseEvent.CLICK, montreInstruction)
this.ClipJeu.piece23.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece22.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece21.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece20.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece19.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece18.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece17.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece16.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece15.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece14.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece13.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece12.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece11.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece10.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece9.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece8.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece7.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece6.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece5.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece4.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece3.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece2.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece1.removeEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
}
/*--------------------------fin de la fonction du retour au menu--------------*/
this.ClipJeu.clipGagne.reessayer.addEventListener(MouseEvent.CLICK, rejouer2)
this.ClipJeu.clipPerdu.reessayer.addEventListener(MouseEvent.CLICK, rejouer)
function rejouer(e:MouseEvent){
this.ClipJeu.clipPerdu.visible=false;
this.ClipJeu.clipPerdu.play()
this.ClipJeu.piece23.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece22.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece21.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece20.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece19.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece18.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece17.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece16.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece15.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece14.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece13.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece12.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece11.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece10.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece9.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece8.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece7.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece6.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece5.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece4.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece3.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece2.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece1.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
/*----------------------------------------------------------------------*/
//Mouse up pour déposé les pièces
this.ClipJeu.piece23.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece22.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece21.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece20.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece19.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece18.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece17.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece16.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece15.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece14.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece13.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece12.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece11.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece10.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece9.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece8.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece7.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece6.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece5.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece4.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece3.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece2.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece1.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
}
function rejouer2(e:MouseEvent){
this.ClipJeu.clipGagne.visible=false;
this.ClipJeu.clipGagne.play()
this.ClipJeu.piece23.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece22.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece21.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece20.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece19.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece18.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece17.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece16.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece15.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece14.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece13.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece12.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece11.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece10.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece9.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece8.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece7.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece6.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece5.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece4.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece3.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece2.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
this.ClipJeu.piece1.addEventListener(MouseEvent.MOUSE_DOWN, bougePiece);
/*----------------------------------------------------------------------*/
//Mouse up pour déposé les pièces
this.ClipJeu.piece23.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece22.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece21.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece20.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece19.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece18.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece17.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece16.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece15.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece14.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece13.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece12.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece11.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece10.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece9.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece8.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece7.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece6.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece5.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece4.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece3.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece2.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
this.ClipJeu.piece1.addEventListener(MouseEvent.MOUSE_UP, deposePiece);
}
/*-----------------------------------------fin du code--------------------------------------------------*/