flutiflupipo
Messages postés4Date d'inscriptionjeudi 4 décembre 2008StatutMembreDernière intervention20 janvier 2009
-
20 janv. 2009 à 02:41
flutiflupipo
Messages postés4Date d'inscriptionjeudi 4 décembre 2008StatutMembreDernière intervention20 janvier 2009
-
20 janv. 2009 à 12:23
Bonsoir!
Voilà mon problème, j'ai une séquence sur flash.
Dans cette séquence, j'ai une pluie d'objets. Et un plateau au sol permettant de faire rebondir les objets.
J'attache un son au rebond des objets contre le plateau.
Là tout va bien.
Mais j'aimerai avoir des sons aléatoires au contact du plateau. J'ai donc créé trois sons:
-rebond1.mp3
-rebond2.mp3
-rebond3.mp3
Et j'ai codé ceci:
vy=vy+.6;
this._x=this._x+vx;
this._y=this._y+vy;
if (this._y>800) {
this.removeMovieClip();
}
if (this._x<0) {
vx=-vx*.9;
this._x=0;
} else if (this._x>1280) {
vx=-vx*.9;
this._x=1280;
}
if (hitTest(_parent.mousecatch)) {
vy=-vy*.8;
vx=(this._x-_parent.mousecatch._x)/15;
this._y=_parent.mousecatch._y-(this._height/2);
var my_sound:Sound = new Sound();
function playRandomSound():Void{
var numSon:Number = Math.round(Math.random()*3);
my_sound.attachSound("rebond"+numSon+".mp3");
my_sound.start(0,1);
}
flutiflupipo
Messages postés4Date d'inscriptionjeudi 4 décembre 2008StatutMembreDernière intervention20 janvier 2009 20 janv. 2009 à 02:44
Bonsoir!
Voilà mon problème, j'ai une séquence sur flash.
Dans cette séquence, j'ai une pluie d'objets. Et un plateau au sol permettant de faire rebondir les objets.
J'attache un son au rebond des objets contre le plateau.
Là tout va bien.
Mais j'aimerai avoir des sons aléatoires au contact du plateau. J'ai donc créé trois sons:
-rebond1.mp3
-rebond2.mp3
-rebond3.mp3
Et j'ai codé ceci:
vy=vy+.6;
this._x=this._x+vx;
this._y=this._y+vy;
if (this._y>800) {
this.removeMovieClip();
}
if (this._x<0) {
vx=-vx*.9;
this._x=0;
} else if (this._x>1280) {
vx=-vx*.9;
this._x=1280;
}
if (hitTest(_parent.mousecatch)) {
vy=-vy*.8;
vx=(this._x-_parent.mousecatch._x)/15;
this._y=_parent.mousecatch._y-(this._height/2);
var my_sound:Sound = new Sound();
function playRandomSound():Void{
var numSon:Number = Math.round(Math.random()*3);
my_sound.attachSound("rebond"+numSon+".mp3");
my_sound.start(0,1);
}
flutiflupipo
Messages postés4Date d'inscriptionjeudi 4 décembre 2008StatutMembreDernière intervention20 janvier 2009 20 janv. 2009 à 12:23
C'est bon j'ai trouvé ce matin au travail.
function playRandomSound():Void{
var my_sound:Sound = new Sound();
var numSon:Number = Math.round(Math.random()*3);
my_sound.attachSound("rebond"+numSon+".mp3");
my_sound.start(0,1);
}
if (hitTest(_parent.mousecatch)) {
vy=-vy*.8;
vx=(this._x-_parent.mousecatch._x)/15;
this._y=_parent.mousecatch._y-(this._height/2);