Cambiar de color a B y N un botón cuando se termine un sonido

Tengo un proyecto con animales, en pantalla están en B y N, cuando se pulsan cambian a color y se reproduce un sonido, cuando se termine de reproducir el sonido debe volver el botón a

B y N, pero solo vuelve cuando pulso otro botón

Your description does not contain enough information to see what is wrong.
Please upload a screenshot of your blocks (click on an empty space in your blocks editor with your right mouse button and choose download blocks as image).
Cheers, Ghica

1 Like

El ejercicio consiste en que cuando pinchas en una imagen de un animal que está en B Y N, esta se pone en color y a la vez suena el sonido de dicho animal, cuando deje de sonar el sonido, la imagen debe volver a ponerse en B y N sola. Pero con esta disposición de los bloques, cuando deja de sonar el sonido se queda en color y se pone en B y N cuando pulso la imagen de otro animal.

The exercise consists in that when you click on an image of an animal that is in BYN, it turns into color and at the same time the sound of said animal sounds, when the sound stops sounding, the image must go back to B and N alone. But with this arrangement of the blocks, when the sound stops playing it stays in color and turns to B and N when I press the image of another animal.

Hi Aprietonu

Your code is very nearly there. Since we do not know when the sound ends, we must end it. This can be done with a timer:

OnSoundStop.aia (1.3 MB)

1 Like

As an alternative to the suggestion of Chris, you could use the Player component instead of the Sound component, because the Player component has a completion event which you can use to make the picture black and white again.
I adapted Chris’ example to use the Player. Somehow you should maybe also use a timer to have a maximum sound duration. The frog sound of Chris never stops it seems.
Nice example and pictures, Chris!
OnSoundStop_wPlayer.aia (1.3 MB)

Cheers, Ghica

1 Like

Gracias, voy a probar las soluciones.