Skip to main content
Inspiring
March 25, 2022
Answered

Mouse click sound placed on button down state only works first time

  • March 25, 2022
  • 2 replies
  • 468 views

I reuse a button several times. Each instance I use the button, I have it named uniquely so I can access it through the code.  I have an mouse down event to play the mouse click sound in my library, an mp3. The first time it works fine. But never works again.

 

Here are my settings when editing the button:

 

Any ideas as to how to make the button sound click every time it is clicked upon?

 

    This topic has been closed for replies.
    Correct answer KansasSteve

    Okay, my work-around worked! So if you want to reuse a sound file, that ain't happening so duplicate it and name it differently. Also, you gotta create a unique button each time, or it still won't work. So, duplicate naming for sounds, and unique buttons, and no reusing buttons. But keep your instance name (even though there will be no more of them). 

    2 replies

    JoãoCésar17023019
    Community Expert
    Community Expert
    March 25, 2022

    Hi.

     

    Are you setting the sound to be played in the IDE only or using code?

     

    Please let us know.

     

    Regards,

    JC

    Inspiring
    March 25, 2022

    I pasted shots from the integrated development environment I believe, thus the screen shots above. Or am I mistaken? 

    KansasSteveAuthorCorrect answer
    Inspiring
    March 25, 2022

    Okay, my work-around worked! So if you want to reuse a sound file, that ain't happening so duplicate it and name it differently. Also, you gotta create a unique button each time, or it still won't work. So, duplicate naming for sounds, and unique buttons, and no reusing buttons. But keep your instance name (even though there will be no more of them). 

    Inspiring
    March 25, 2022

    If I duplicate the mp3 sound file and name it differently, it works once too when called. Do I need add duplicates of the sound file in my library for every button press?