dav21
Oct 20 2008, 11:47 AM
Bonjour.
Ben voilà, tout est dit dans mon titre!

En fait j'ai une vidéo avec le son intégré. Je désirerais arrêter le son à un moment donné et que l'autre son continue.
Merci
dav21
Oct 20 2008, 01:32 PM
Bon, j'ai avancé sur le sujet avec le code suivant:
# var clipSon1:MovieClip = this.createEmptyMovieClip("clipSon1",0);
# var clipSon2:MovieClip = this.createEmptyMovieClip("clipSon2",1);
#
# var monSon1:Sound = new Sound(clipSon1);
# monSon1.attachSound("son1");
# monSon1.start();
# var monSon2:Sound = new Sound(clipSon2);
# monSon2.attachSound("son2");
# monSon2.start();
#
# monSon1.setVolume(0);
# monSon2.setVolume(50);
Il faut mettre ce code sur la scène principale
Voilà, j'ai trouvé ça sur un autre forum. Mais comme je débute, je pioche sur un problème tout bête:comment baisser le volume du "monSon1" pas au début mais qu'à partir d'une certaine image?
Merci
dav21
Oct 20 2008, 06:33 PM
Bon ben j'ai trouvé comment faire:
var clipSon1:MovieClip = this.createEmptyMovieClip("clip1", 0);
var clipSon2:MovieClip = this.createEmptyMovieClip("clip2", 1);
var monSon1:Sound = new Sound(clipSon1);
monSon1.attachSound("Mulholland_Drive-Opening_Scene.flv");
monSon1.start();
var monSon2:Sound = new Sound(clipSon2);
monSon2.attachSound("11 Caramel Prisoner.mp3");
monSon2.start();
monSon1.setVolume(50);
monSon2.setVolume(50);
clip1.onEnterFrame=function(){
if(clip1._currentframe > 446){
monSon1.setVolume(0)
}
};
Mais voilà, comme je tâtonne petit à petit, j'ai un nouveau problème: mon fichier mp3 "caramel prisoner" se lit normalement, mais au bout d'un moment, alors que la lecture du fichier n'est pas finie , j'entends une nouvelle lecture du même fichier qui vient se superposer sur la première. Quelle mauvaise manip ai-je fait? Que dois-je faire?
dav21
Oct 20 2008, 08:20 PM
Bon j'ai trouvé. J'avais mis le mp3 sur le scénario et en même temps je l'avais lié, du coup ça s'est superposé.
dav21
Oct 21 2008, 01:02 PM
Bonjour, là je comprend pas. En fait, j'ai rajouté du code pour éteindre le son2 plus loin dans le scénario et remettre le son1. ça marche mais par contre du coup, à l'image 446, ça marche plus! Pourquoi?
var clipSon1:MovieClip = this.createEmptyMovieClip("clip1", 0);
var clipSon2:MovieClip = this.createEmptyMovieClip("clip2", 1);
var monSon1:Sound = new Sound(clipSon1);
monSon1.attachSound("Mulholland_Drive-Opening_Scene.flv");
monSon1.start();
var monSon2:Sound = new Sound(clipSon2);
//monSon2.attachSound("11 Caramel Prisoner.mp3");
monSon2.start();
monSon1.setVolume(80);
monSon2.setVolume(50);
clip1.onEnterFrame=function(){
if(clip1._currentframe > 446){
monSon1.setVolume(0);
}
};
clip1.onEnterFrame=function(){
if(clip1._currentframe > 758){
monSon1.setVolume(50);
}
};
clip2.onEnterFrame=function(){
if(clip2._currentframe > 758){
monSon2.setVolume(0);
}
};
dav21
Oct 21 2008, 02:38 PM
bon ben j'ai trouvé:
var clipSon1:MovieClip = this.createEmptyMovieClip("clip1", 0);
var clipSon2:MovieClip = this.createEmptyMovieClip("clip2", 1);
var monSon1:Sound = new Sound(clipSon1);
monSon1.attachSound("Mulholland_Drive-Opening_Scene.flv");
monSon1.start();
var monSon2:Sound = new Sound(clipSon2);
//monSon2.attachSound("11 Caramel Prisoner.mp3");
monSon2.start();
monSon1.setVolume(80);
monSon2.setVolume(50);
clip1.onEnterFrame=function(){
if(clip1._currentframe > 446){
monSon1.setVolume(0);
}if(clip1._currentframe > 758){
monSon1.setVolume(50);
}
};
clip2.onEnterFrame=function(){
if(clip2._currentframe > 758){
monSon2.setVolume(0);
}
};
voili voilou
Ceci est une version "bas débit" de notre forum. Pour voir la version complète avec plus d'informations, la mise en page et les images, veuillez
cliquer ici.