PDA

View Full Version : Button Sound


eric_o
07-02-2004, 06:54 PM
I cant get my buttons to play sound upon rollover. I import my sound to the library and then go in the button window and drag the sound file onto the over keyframe. When I do this a little wave appears in that frame...now i go back to the movie, and click "enable simple buttons" and upon rollover the DOES Play. But then when i test the movie the sound does not play! I dont understand why not and I figure it must be something small. If anyone can help Id appreciate it. thanks

toke
07-02-2004, 08:17 PM
did you write any AS on the button? if not you need to write the script so it works when you test the movie. right click on your button and open the actionscript panel


on(rollOver){
gotoAndPlay(2); // suppose frame two is where you imported your sound into
}

on(rollOut){
gotoAndStop(1);
}



something like this :D

JEBoothjr
07-02-2004, 09:33 PM
Click on the frame with the audio and check the properties. Make sure that the "Sync" is set to "Event" and not "Stream".

Aside from that, I would probably use the Sound object. You can centralize all of your code and have more control over you functionality.

In this short example, the linkage name for the audio file is "Click" and the button is called "myBTN".


clickSound = new Sound ();
clickSound.attachSound ("Click");
//
myBTN.onRollOver = function () {
clickSound.start ();
};

eric_o
07-02-2004, 10:04 PM
awesome!!! thats what the problem was...it was set to stream! but I think I might try using AS. Ill give it try tonight. thanks so much guys!