Action script pour arréter un son dans une animation flash
zrellianiss
Messages postés26Date d'inscriptionlundi 30 mars 2009StatutMembreDernière intervention 5 juin 2010
-
3 avril 2009 à 09:44
cs_Girou
Messages postés1203Date d'inscriptionlundi 10 mars 2003StatutMembreDernière intervention23 juillet 2009
-
3 avril 2009 à 10:01
Bonjour
dans une animation flash saisissant plusieurs pages, j'ai introduit un son. Parmi ces pages là j’ai une page vidéo. Le problème ici est comment arrêté le font sonore sans arrêté le son du vidéo sachant qu’il y a deux boutons « on » et « off sound » dans l’animation contrôler par un clip de contrôle ?
L’action script de contrôle est comme suit :
onClipEvent (load)<?xml:namespace prefix o ns "urn:schemas-microsoft-com:office:office" /??>
{
_root.soundstatus = "on";
_root.mySound = new Sound(_level0);
_root.mySound2 = new Sound(_level1);
_root.mySound3 = new Sound(_level2);
_root.mySound4 = new Sound(_level3);
_root.mySound5 = new Sound(_level4);
maxvolume = 100;
minvolume = 0;
}
onClipEvent (enterFrame)
{
if (_root.soundstatus == "on")
{
step = 5;
} // end if
if (_root.soundstatus == "off")
{
step = -5;
} // end if
maxvolume = maxvolume + step;
if (maxvolume > 100)
{
maxvolume = 100;
} // end if
if (maxvolume < 0)
{
maxvolume = 0;
} // end if
_root.mySound.setVolume(maxvolume);
_root.mySound2.setVolume(maxvolume);
_root.mySound3.setVolume(maxvolume);
_root.mySound4.setVolume(maxvolume);
_root.mySound5.setVolume(maxvolume);
}
Sur le bouton "on" et "off"
on (release)
{
gotoAndStop(1);
_root.panel.so.play();
_root.soundstatus = "on";
}
Le clip de "on" et "off" comprend deux images accompagné par deux action script « stop »
Enfin merci de me répondre le plus vite possible sachant que cette animation est un site dois être délivré aujourd’hui ou demain au grand maximum.
merci infiniment pour votre aide et bonne journée.
cs_Girou
Messages postés1203Date d'inscriptionlundi 10 mars 2003StatutMembreDernière intervention23 juillet 20092 3 avril 2009 à 10:01
Bonjour,
pour lancer ton ou tes sons... je suppose que tu fais un _root.mySound.start() et bien pour l'arreter, tu fais un _root.mySound.stop(_level0)
sinon, va voir du coté de stopAllSounds();
heu, tes 5 sons ne se jouent pas en même temps là ?
Ca, c'est le truc qui me fait toujours bien rire :
"Enfin merci de me répondre le plus vite possible
sachant que cette animation est un site dois être délivré aujourd'hui
ou demain au grand maximum."
Pourquoi le dernier jour se rend-on tout a coup compte qu'un truc aussi essentiel (que la bande son dans ton cas) foire... mystère.