How can i make e clickable once “a” is completed

The changing of colors is working now. Thank you very much. I already put the sound files as well.

Now, I put a back button in Listening_Exercise1 (a screen)
I hid the back button when Listening_Exercise1 Initialize so it will appear in the next pace instead.

I want the back button to go the previous screen. For example "a" next is "ba" the image and sound component for "ba" will be shown, but once I click the back button, it will return to image "a" and " component "a". Since I have a lot of buttons, images and sound components, I am trying to use these blocks. Could you please help me figure it out?
image

FilPHLa_Final (1).aia (2.7 MB)

In this screen, I have 2 buttons and 2 vertical arrangements.
image

Vertical Arrangement 1. Home (User can choose which listening exercise they want to do first. - buttons)
Vertical Arrangement 2: ListeningExercise_1

image

when I am in Vertical Arrangement: ListeningExercise_1. If I click button "a" it will open another screen called "Listening_Exercise1" with a start value "aa.img, SoundA" ( i don't know if this is possible, this is the plan I came up, please help.), if I click button "ba" it will open the "Listening_Exercise1" screen again with a start value "baa.img, SoundBa".

image
when I click that it should open another screen (The main purpose of this Vertical Arrangement is if the user wants to jump with a particular phonetic sound they could skip the other sounds instead of starting from "a" over and over again.

Is this possible?

This is what I've tried so far.

Thank you very much.

image
I have 77 buttons, I made until Button54, I couldn't add anymore. I don't know why.

You still haven't learned the lesson of Don't Repeat Yourself (DRY).

I recommend you take this tutorial, to see how to reuse components from a list:

https://appinventor.mit.edu/explore/ai2/quizme

1 Like

Thank you. I will try again.

Here is a very small app that lets you play each phoneme.


phonics1.aia (2.6 MB)

Designer

Explanation, step by step:

We need only one global variable, the list of phoneme file names.
blocks

At app startup, we need to fill it.


The File component has a block to list all the file names in a directory.
Here, I ask for the Asset file scope, which covers all the mp3 files that were uploaded into this Project's Media folder (among others).

We use a List Picker to offer the selection of phonemes the user might want to hear.

This is the event that fills the Elements of a List Picker between the moment you Click the List Picker (it looks like a button before triggered) and before the List Picker lists out all its Elements for the user to choose from.

We read the data flow from right to left, coming from the global variable files that was populated earlier.

We first filter out the file names that contain ".mp3", because those are phoneme sound files.
Since we just want to name of the phoneme with out the .mp3 part at the end, we run the list through a list block that lets us map incoming values to improved values, in this case by replacing the ".mp3" part of the name with an empty string. Don't worry, the files list is still there, we are just working with a temporary copy to fill the Elements list of the List Picker.

By this point, the Elements list just has small phoneme names, little pieces of text from the mp3 file names. They are all unique, as good phoneme names should be.


This is the part of the List Picker where I must tell it what to do with the user's Selection.
A Selection is the Element the user poked.
In this case, it is the name of a phoneme, so we set the lpkPhoneme.Text value to that Selection.
This gives the user feedback that he didn't miss with his finger, and releaves the user of having to hold that phoneme name in his head for too long.
Once we have the phoneme name, it is time to prime our one and only Player component (Player1), with the name of the sound file it should play if and when we ask it to play its sound.

Now we tell the Player Player1 to Start its sound.

We have a Play button to let the user play the currently loaded Player1 sound file again.
We could have just loaded its .Text value up with the Selected phoneme name, with nice big bold font and color set in the Designer, but for some strange reason the developer thought button background image files were better. That mess is hidden in the value procedure image , further below.


This is the Play button, which doesn't actually have the .Text "Play", but has had its background image loaded with an image of the text of the current phoneme selection. (It's an indullgence.) When the Click event fires, we set the Source of thePlayer to the name of the mp3 file for the currently selected phoneme. The file name is built up from a Text JOIN of the phoneme and ".mp3", reversing what was done to get the clean list of phoneme Elements earlier in the List Picker.
Once the Player is ready with the proper file name, we tell it to Start.


This is the final missing piece, the value procedure that can take a phoneme ("ba") and turn it into a matching .png file name from the Media folder. For some strange reason, the original developer added an extra letter to the file name ("baa.png") matching the vowel letter. So since the vowel letter is at the end of the phoneme name, we use the length of the phoneme text in characters to tell us which letter the segment block should pull out of the phoneme. We then make a three level sandwich to build up the file name

  • phoneme
  • extra vowel letter
  • .png

and then that's what the value procedure returns.

1 Like

I don't understand. How did you make sure that the button, image, and sound is equal with each other? I ran the app that you provided, and they are all correct. I honestly don't understand the blocks you showed me. Sorry, I am quite slow when it comes to this, my brain is not good in understanding them fully. I tried to read the information in the link you gave me on how to do DRY. I still don't understand how will I apply it to my app.

Thank you for trying to help me, I appreciate you.

When I click button A, it will go to VA2 particularly in picture A and sound A.

image

This is Vertical Arrangement 2

If I click the Home Button in VA2 it should go to VA1. Now my problem begins here,
clicking the Home Button and going back to VA1 is a success but when I click Button Ba from VA1 it will go to VA2 with Ba picture and sound, but the image and sound A was still there.

How will I make sure that every time I click the button from VA1, the previous components will not be shown?

This is what I tried.

Please help.
FilPHLa_Final_September23.aia (2.8 MB)

http://www.appinventor.org/book2

1 Like

@ABG could you please help me figure out the solution for this problem? Thank you so much. This is the last problem. after this I can finish and submit the app to my teacher.

Study the chapters on variables, lists, and procedures in the free book.

You should not submit work you don't understand.

1 Like

Yes, thank you, I am currently reading it. I will be able to understand the blocks even more quickly once I apply them in my app. Just like the first blocks you gave me. The previous ones with the phonemes were a bit confusing for me because I don't know the purposes of the join blocks, why do I need them, and the segments too. Thank you for attaching the free book. I will read and study them.

Don't worry, I really need to understand everything because I will present it and will explain every block. Thank you for your concern. I appreciate it.

I regret I will be unable to help further.

I am in hospital with a hip fracture.

I leave you to the other power users.

Good luck with your project.

:flushed: I wish you a speedy recovery!

2 Likes

Oh no, I am so sorry to hear that.

Thank you so much for your help. I was able to understand things and make progress in my project.

Wishing you a fast recovery. Take care always, please.

Once again, thank you so much. I appreciate you a lot.

1 Like

I'm back, with new hip and some doctor jokes:

So doctor, what's my prognosis?
Your Mercury is in Uranus ...
I'm not into Astrology...
No, we broke off a thermometer in you.

Me, going into the surgery:
Are you a hip surgeon?
Surgeon: Yes, (apprehensively)
Me: Cool, Man!

2 Likes

Hi! I’m glad you’re okay and got a new hip. :face_with_hand_over_mouth:

Funny :rofl: Are you ready to bone up on recovery?

1 Like

Hi! Question. If I have the sound files, do I still need to use the Text to Speech component, or the previous one you told me, which is 1 sound file for each phoneme? Thank you.

No.

I used it because I did not have sound files.

You still have to be in control of how you build the file name of the sound file appropriate to the choice of consonant and vowel, before you load the Player with that sound file name.

I see.

So, in my case. Based on what you've showed me before, instead of .Text
image
I will instead call the sound file by clicking the sound buttons?