No buttons working at all

Hi guys, I am making a guitar tuition app and have several screens which are the chord screens. Basically my home screen has a-g chords to choose from, each of which has a button to open the corresponding screen. So when I press the A chords button, it should go to the A chords screen. Trouble is, none of the buttons are working at all. Any ideas?

Thank you.

show your blocks ...

Apologies, please see the blocks in the image.

Are you using the companion or a compiled .apk?
Does the “Click” sound play?

1 Like

You shouldn't open a new screen for every chord, see here: Tip 1

1 Like

I have tried both the companion and an apk. No, no click sound at all. Nothing happens what so ever,

It isn’t a new screen for every chord. It’s a new screen for each set of chords. So all the A chords is on 1 screen, all the B chords on 1 screen. And so on.

Ok, but that shouldn't be necessary either ... and did you add the click sound files (which format) to the assets ... so before we continue puzzling, post the aia.

Yes the click sound has been added in mp3 format. Here is an image of the home screen and the components so far.

@loganbiffy Does the sound play if you drag out a copy of the Play block and use the “Do It” item on the right click menu (needs active companion connection)? It might be the case that preparing to play the sound takes longer than switching the screen so the sound doesn’t play. This will help show whether that is a possibility or not.

Hi ewpatton. Yes I have just tried this, the sound plays with the what you have suggested trying.

For me the sound is played before the screen is swichted (Companion & APK).
Try this: chords.aia (7.1 KB)



Hmm. Maybe you could try the following then:

In the blocks palette open the “Any Component” section and find the “Any Button” entry. Select that and find the when any Button.TouchDown event and drag that into the workspace. Place your call Click.Play block in that event rather than in the when ____.Click event and see if that helps.

The Player component has an event that fires after it finishes playing.
Would that be a better place to check if a screen change is wanted?

1 Like

Yes, of course, because if the sound has a certain length and should be heard completely, then this would be a better solution.

1 Like

Yes the sound plays on yours before the screen is clicked.
I have exported my project (aia). If I upload it can someone please take a look at it?

Here is my aia file if anyone wants to take a look at it. No idea what’s going wrong.
GuitarTuition.aia (3.1 MB)

Here is a reworked copy, using a Player onstead of a Sound, to get the completion event,
and with revised screen handling for the first 2 screens, screen1 and A_chords.
PlayerClick GuitarTuitionABG.aia (3.1 MB) A_chords

I leave it to you to do the remaining screens,
Unless you switch to a single screen table based approach (wiser).

See here:

This is so weird. The buttons all line up on my screen!
Why would that happen?