ToddziLLa
January 15th, 2003, 08:29 AM
OK, I have 4 loops in my movie. I have a button that I want to change between those loops, as well as a button that mutes and unmutes the sounds. I have a script for both, but neither of them work at all. What's wrong?
Here's the script for the changing button (by the way, my sounds are linked by sound1, sound2, sound, and sound4);
on (press) {
_root.number=_root.number+1;
if (_root.number==4) {
_root.number = 1;
trace (_root.number);
}
_root.Sound.loop.stop();
_root.Sound.loop.attachSound("sound"+_root.number);
_root.Sound.loop.start(0, 999);
}
And here is my code for the mute/unmute button;
on(release)
{
_root.muted = _root.muted
if(_root.muted) _root.Sound.loop.setVolume(0)
else _root.sound.loop.setVolume(100)
}
Neither of them work, can someone post scripts that will work? Thanks.
Here's the script for the changing button (by the way, my sounds are linked by sound1, sound2, sound, and sound4);
on (press) {
_root.number=_root.number+1;
if (_root.number==4) {
_root.number = 1;
trace (_root.number);
}
_root.Sound.loop.stop();
_root.Sound.loop.attachSound("sound"+_root.number);
_root.Sound.loop.start(0, 999);
}
And here is my code for the mute/unmute button;
on(release)
{
_root.muted = _root.muted
if(_root.muted) _root.Sound.loop.setVolume(0)
else _root.sound.loop.setVolume(100)
}
Neither of them work, can someone post scripts that will work? Thanks.