Hi gang and Klaus
I have a little problem I don't seem to get buy... I am creating an installation where I will be hacking a keyboard to be able to make step-able keys.
What I am trying to do is if Key is down it plays a certain sound and it keeps playing it until the key has been released. How I am doing this right now is like this.
Code
<plugin name="soundinterface" url="plugins/soundinterface.swf" rootpath="%CURRENTXML%" onloaded="" />
<events
onkeydown="action(keydown);"
onkeyup="action(keyup);"
/>
<action name="keydown">
trace(keydown - keycode=,keycode);
if(keycode == 83, playsound(s1,breathe.mp3); );
</action>
<action name="keyup">
trace(keyup - keycode=,keycode);
if(keycode == 83, stopsound(s1); );
</action>
Alles anzeigen
But the problem there is, as soon as key 83 is pressed and being held down the sound just starts playing over and over again from the beginning only getting small portion of the sound... Is it possible to have an action that would be "keyPressed" that states if the key is being held down keep on running the sound?
I hope you get what I am getting at.
Hope for a quick reply... Thanks gang.