AudreyLucy
Technical User
Hello,
I'm attaching sound objects to a button.
I imported the sounds into the library...and typed identifiers for the linkage IDs. I've checked them on numerous occassions to verify that there are no typos.
I've defined the sound objects, in the first frame of the mc, the buttons reside in. Here's what the script looks like in that first frame:
mouseOver= new Sound();
mouseOver.attachSound("mouseOver01"
;
click= new Sound();
click.attachSound("click01"
;
Then I selected the button on the stage and applied these actions to the button:
on(rollOver){
if (playing!=true) {
_root.buttons_mc.mouseOver.start();
playing=true;}
}
on(rollOut){
_root.buttons_mc.mouseOver.stop("mouseOver01"
;
playing=false;
}
on (press){
if (playing!=true) {
_root.buttons_mc.click.start();
playing=true;}
}
I have had success making "mouseOver" (rollover sound) play when the cursor touches the button and stop when the cursor rolls off the button. But I'm having difficulty figuring out why the "click" (on press sound) won't play when the button is pressed.
Maybe someone can spot a typo or something that I haven't noticed yet...Can someone please help me out?
Thank you
I'm attaching sound objects to a button.
I imported the sounds into the library...and typed identifiers for the linkage IDs. I've checked them on numerous occassions to verify that there are no typos.
I've defined the sound objects, in the first frame of the mc, the buttons reside in. Here's what the script looks like in that first frame:
mouseOver= new Sound();
mouseOver.attachSound("mouseOver01"
click= new Sound();
click.attachSound("click01"
Then I selected the button on the stage and applied these actions to the button:
on(rollOver){
if (playing!=true) {
_root.buttons_mc.mouseOver.start();
playing=true;}
}
on(rollOut){
_root.buttons_mc.mouseOver.stop("mouseOver01"
playing=false;
}
on (press){
if (playing!=true) {
_root.buttons_mc.click.start();
playing=true;}
}
I have had success making "mouseOver" (rollover sound) play when the cursor touches the button and stop when the cursor rolls off the button. But I'm having difficulty figuring out why the "click" (on press sound) won't play when the button is pressed.
Maybe someone can spot a typo or something that I haven't noticed yet...Can someone please help me out?
Thank you