How to obtain the name of a button dynamically?

I'm sorry, I don't want disturb you

Hi again, Alaqmar_Bohori,
I've done a test and the result is what you can see in the picture, I'm going to try it again to see what I'm doing wrong.
Best regards,


Captura4

Yeah, this is how app inventor recognizes buttons,
so after this

image

Thank you again, Alaqmar_Bohori, I'll try it later, now I must go at work, I'll say you the result.
Bestia regards,

image

This is what I think you are trying to do!
And this is a difficult way of doing what I showed above

image

To associate a list of buttons with a list of images or URLs,
you need to set up a list of the button components, and a lookup table
that can take a button component and return the matching data (URL, sound, etc) .

Here is a sample app or two ...

Good morning, Alaqmar_Bohori.
Excuse me for my delay replying you.!
I've done a little test with your code and, finally, I think that is not valid for my project. Look:

  • With your code I can obtain the text of a button but not the name of the button, which is what I need. I can do a little trick that is to assign a text to the button with TextColor=none and make use of it. Well, it works, but I think that this is not a very professional.
  • More: Using this method, I can change the image of the button when it changes from off to on, but I can't see the way that I can change it again when its status returns from on to off.
  • And last, I have more buttons with other functions -media player, timer- that can be affected -I think- in the wrong way.

Well, Alaqmar_Bohori, thanks a lot again to you for your effort. All the best,

Captura7 Captura8

Good morning, ABG,
Thank you for your help and excuse me, please, for my delay replying you.
Ufff... very hard code for a newbie as me , but I'm going to study it and I'll try to do a good use of it.
Best regards,

Why do you need the actual name of the button?

Please see my toggle button :

blocks

Hi, TIMAI2,
Because I want to do something similar to this:


But I need the button name, obviously :smile:
Thanks a lot

I think this can shorten your button blocks :

blocks (1)

Hi, Salman_Dev,
It's a good idea but, in your example, Button1, Button2, and Button3 are the text attribute of each button, and I need the name of the button.
I can do, as I said before, let the text with no color, but I don't like this way, is not very professional, don't you believe it? :confused:
Best regards,

I think it's quite professional but it's all up to you

blocks (3)

I think you might be interested in this extension :

I'll see later, Salman_Dev, I'm testing your last code, I'd like to give you an opinion.
Thanks a lot!

:grin: :+1:

Seeing this i interpret that you would like to set the picture to the name of the button,
for that you could try this:

image

or simply -

image

This code can also be added in the after click events of respective buttons!

I'm sorry Mr.@Alaqmar_Bohori, I already told him

I didnt get you! :thinking: