Avatar of needanansweryesterday
 asked on

click button sound

Hi all.

I have a "enter site" link set up on an index page. After the SWF finishes playing, I need the visitor to hear a click sound when they click the enter link.

Right now the enter link is controlled by AS3 in the SWF. I cannot figure out how to add the sound. If I just just the properties palette, it causes the whole SWF to loop. If I add some AS3 I found to the final frame of the "enter site" link movie it also causes the SWF to loop.

Can someone help me figure out exactly how to write the AS3 and where to put it in the Flash file?

Flash file is attached.

Thanks in advance.
Adobe FlashApple Software

Avatar of undefined
Last Comment

8/22/2022 - Mon

you can either put the sound in the library or load it at runtime. if it's a small button click sound the library option should work.

import it, give it a class identifier i.e in this case Stop. stick the code in your current click handler.

var snd:Stop= new Stop();

yourexitbtnName.addEventListener (MouseEvent.CLICK, soundbutton_Handler);

function soundbutton_Handler (e:MouseEvent):void {

blue-genie - I appreciate your help.

My problem is I don't know squat about AS and am not a developer, thus, I don't really know what to do with your sage advice.

To make matters worse, I don't even know that I can frame an intelligent question on this subject, but...

the code you gave me - I'm guessing - should either go on the last frame of the "enterlink" movie instance, or on the last frame of the animation, right?

As of now, the last frame of the animation has this code:

function mouseclicked(e:MouseEvent):void{
    navigateToURL(new URLRequest("http://www.catalystad.com/test/catalyst/portfolio_logo_1.html"));
function hilite(e:Event):void{
function lolite(e:Event):void{

eb.buttonMode = true;
eb.mouseChildren = false;
eb.addEventListener("rollOver", hilite);
eb.addEventListener("rollOut", lolite);
eb.addEventListener("click", mouseclicked);

The long and short of it is, I don't know how to integrate your code into what is already existing....

Are we having fun yet?

View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes