sMALLQuestions
Programmer
HI all.
I can’t seem to get this sound code to work.
I want this loop to start counting the the number of times the sound has been played.
So that after ,say 3 times, the sound is volumed down to 50%.
The problem is that there are many scenes and I need to declare the variable global so that the counting doesn’t clear off.
I actually placed the sound (called “destination” in the library) in a MC called “cyborgsnd”. Then I placed it on the scene. And the code is on this MC”cyborgsnd” :
onClipEvent (load) {
_root.cyborgsoundplayed = ++_root.cyborgsoundplayed;
if (_root.cyborgsoundplayed >= 3) {
cyborgsound = new Sound();
cyborgsound.setVolume(50);
} else {
_root.cyborgsoundplayed = ++_root.cyborgsoundplayed;
trace(_root.cyborgsoundplayed);
}
}
I have tried to test this movie.
but the TRACE action always displays "2". I have a few movies that the user have to browse, so when you come back to it i don't want to have this annoying voice repeated over and over again.
BTW: how do you target each sound anyway? i only know how to target all sounds. because i can not set an instance name of sound symbols...
can someone help? Thanks in advance!
I can’t seem to get this sound code to work.
I want this loop to start counting the the number of times the sound has been played.
So that after ,say 3 times, the sound is volumed down to 50%.
The problem is that there are many scenes and I need to declare the variable global so that the counting doesn’t clear off.
I actually placed the sound (called “destination” in the library) in a MC called “cyborgsnd”. Then I placed it on the scene. And the code is on this MC”cyborgsnd” :
onClipEvent (load) {
_root.cyborgsoundplayed = ++_root.cyborgsoundplayed;
if (_root.cyborgsoundplayed >= 3) {
cyborgsound = new Sound();
cyborgsound.setVolume(50);
} else {
_root.cyborgsoundplayed = ++_root.cyborgsoundplayed;
trace(_root.cyborgsoundplayed);
}
}
I have tried to test this movie.
but the TRACE action always displays "2". I have a few movies that the user have to browse, so when you come back to it i don't want to have this annoying voice repeated over and over again.
BTW: how do you target each sound anyway? i only know how to target all sounds. because i can not set an instance name of sound symbols...
can someone help? Thanks in advance!