Hi Jerod,

On Fri, Dec 5, 2008 at 1:53 PM, Jerod Venema <[EMAIL PROTECTED]> wrote:

> The second argument should be an anonymous object. This should work:
>
> play('http://myurl.com/sound.wav', { replace: true });
>

The code I'm using to call Sound.play (the 'new' version below) is:

function Beep() {
    this_sound = "../sounds/item_found.wav"
    Sound.play(this_sound, {replace:true})
}

function Burp() {
    this_sound = "../sounds/item_not_found.wav"
    Sound.play(this_sound, {replace:true})
}

function Swoosh() {
        this_sound = "../sounds/item_deleted.wav"
    Sound.play(this_sound, {replace:true})
}

This works.  Not 100%.  I'm still getting an occasional 'bounce' in the
sound:  it'll 'double ding'.  But it's working.

Same code with the latest version of sound.js is throwing an exception.

Last version of my code code, where I was calling Sound.play directly from
my Rails RJS code rather than calling another function that then called
Sound.play, does not throw an exception.


>
> On Fri, Dec 5, 2008 at 1:29 PM, Bill Walton <[EMAIL PROTECTED]> wrote:
>
>> I think I've found a bug in the latest release of sound.js.
>>
>> This is the code in sound.js
>>
>> play: function(url){
>>   if(!Sound._enabled) return;
>>   var options = Object.extend({
>>     track: 'global', url: url, replace: false
>>   }, arguments[1] || {});
>>
>>
>>
>> In order to get the replace to work (to eliminate double-ding), I had to
>> change it to...
>>
>>   play: function(url){
>>     if(!Sound._enabled) return;
>>     var options = Object.extend({
>>       track: 'global', url: url, replace: arguments[1] || {} });
>>
>> I'm not real strong in JavaScript, but it looks to me like replace is
>> hardcoded in the lates release.  At least, I couldn't get it to change.  Am
>> I doing something wrong?  Or is this a bug?
>>
>> TIA from Texas!
>> Bill
>>
>>
>>
>>
>
>
> --
> Jerod Venema
> Frozen Mountain Software
> http://www.frozenmountain.com/
> 919-368-5105
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to