Extension activity 2: Adding sound asset to the app
For an additional enhancement, let's integrate a sound asset into the app. Follow these straightforward steps to incorporate a sound file along with the button component.
Navigate to the left panel (Panel 1) and click on the
Mediatab. Drag and drop theSoundcomponent onto the screen. Note that the sound component is non-visible, so you won't see any changes on the screen.Upload a WAV sound file, similar to how you uploaded the image file.
Locate the sound file (
switch-1.wav) within the Media folder.Click on
Sound1in theComponentstree. From thePropertiespanel, select the uploaded sound file as theSource.Switch to the
Blockstab and click onSound1. Drag thecall Sound1.Playblock.Move the
Playblock inside both theifandelseparts of the existing code. The final code should resemble the image below:

All done!!!
Last updated
Was this helpful?