function clickSound(clip:MovieClip) : Void { clip.onPress = function() { clip.play(); } } // Là on lie cette fonction à tous nos clips de sons clickSound(snd_chien); clickSound(snd_chat); clickSound(snd_cochon); // ect...
fonction onDrag(clip:MovieClip) : Void { clip.onPress = function() : Void { clip.startDrag(); } clip.onRelease = function() : Void { clip.stopDrag(); } } onDrag(chien); onDrag(chat); onDrag(cochon); // ect...
chien.son = snd_chien; chat.son = snd_chat; // ect...
clip.onRelease = function() : Void { clip.stopDrag(); if (clip.hitTest(clip.son)) { trace("c'est le bon animal!"); } }
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question