AttachSound

Hey everOne…

I want to make a key to make a sound…

Like this.

if (Key.isDown(Key.SPACE)) {
    beep = new Sound;
    beep.attachSound("horn");
    beep.start(0,99);
}

But that code will make it go on forever…

I want it so when im done pressing the space bar it stops completely…

Can someOne help please and fast…

THANKS!!

AnyOne

I love to see a reply

::Bump::

AnyOne

Please reply.

Its not that hard to just say i dont know how or do know how…

Come On …

how about changing 99 to 1???

Im saying that the sound keeps looping when i press the button once
i need it to stpo when pressed once…

Like ,press,play,stop

Maybe now you can help…

Well 99 is the amount of times it loops.

So if you want the sound to only play once when you press the spacebar, changing 99 to 1 will make it only play once.

[edit]no wait… 0 will make it play once, 1 will make it loop once… sorry, so change 99 to 0[/edit]

Ohi get ya know see i saw this code on kirupa tutorals and i thought 0,99 was the volume.

Thanks alot man ill check it out…