Topic: Button sound mp3's?

Hello,
On my flash program that I’d written, I wanted to add a “click” sound to the buttons using the following code:

public function ButtonClickSound() {
                                                     var mySound:Sound= new Sound();
                                                     mySound.loadSound("click.mp3" , true);
                                                     mySound.onLoad = function(true) {
                                                     mySound.start();
                                                                                            }
                                    }

While this works fine in the flash player as well as a browser window, I don’t get the click sound or any sound on the chumby.

Is this a path issue?
Currently I have the click.mp3 file in the mnt/usb folder.

Thanks for any help.

Re: Button sound mp3's?

You may need to provide a full path.  Try "file:////mnt/usb/click.mp3" and see if that works.

Re: Button sound mp3's?

Thanks Duane,
But no...even with the full path I get no sound.

Could it be a crossdomain issue?

Re: Button sound mp3's?

Are you running as a standalone, or as a widget?

If a widget, then yes, it's a crossdomain issue - a Flash Movie loaded from the network can't access the local file system.

Is there any particular reason why the sound can't be included in the movie?

Re: Button sound mp3's?

I’m running “stand alone” so from what I’ve read, I didn’t think that I had to do anything with the crossdomain file.

Why I didn’t just include the mp3?
Well…I can’t justify the cost of Adobe Flash, so I’ve been using Flashdevelop and when I found that I couldn’t just include a mp3 in Flashdevelop without adjusting its properties and converting it to a swf, I figured it was too much trouble when I could just call a file and play it since it's local…

So…yes, I did create a swf today of the mp3 and include it into the build and that works fine.

Still don’t understand why the loadsound worked in a Flash player and browser and not on the Chumby though…

Re: Button sound mp3's?

Not sure - I'll see if I can reproduce the issue.

You could try running the Flash Player with more debug output - it might give a clue:

chumbyflashplayer.x -l 383 -i yourmovie.swf

That's a lower case "L".

Re: Button sound mp3's?

I use the command (chumbyflashplayer.x -l 383 -i yourmovie.swf) to play the click.mp3  ,  if the click.mp3 file is no large than 15k ,  I can listen the sound , if the  mp3 file is large file , no sound . Why ?

Re: Button sound mp3's?

wsn1dy: When you imported audio file, what compression settings were used? How large was the mp3 before import?

Re: Button sound mp3's?

The audio file is MPEG I  44.1khz , file size is about 18k.