I've been working on a button audio toggle that I finally have working okay.
One problem I'm still trying to solve is disabling the hit state for each
button when it is visible. Also, the movie load time takes too long, which
I assume is due to the sound clip being embedded in the movie. Is there a
way to stream the sound so the audio begins immediately? See the referring
URL:
http://www.dwayneepps.com/MHM/index.htm
The button hit state is active for both on and off. I want to disable the
appropriate hit state according to which button is visible. So, if the
playB (audio playing) button is visible then I don't want the button to be
active over the "On" area but only on the "Off". Each button hit state is
set that way, but both are active when the movie plays. I have tried
disabling the hit states with the following code but it hasn't worked.
stopB.enabled=false
Here is the code that I'm using to play the audio and display the buttons:
bgSound = new Sound(this);
bgSound.attachSound("sound1");
bgSound.start(0, 99);
stopB._visible=false;
stopB.onRelease = function() {
bgSound.start(0, 99);
playB._visible=true;
stopB._visible=false;
};
playB.onRelease = function() {
bgSound.stop();
playB._visible=false;
stopB._visible=true;
};
stop();
Thanks in advance for any help.
-D-