Help me guys (Runtime error with any component block)

anyone can help me?
i want to make memory game
thankyou guys

You are trying to use any component block for a button.
Here you have to send a com.appinventor form of the component (com.appinventor.components.runtime.Button for a button).

If you are trying to get a property of Button1 then instead of using a text string, you will have to use Button1 block (image )

See this -

sorrry i still can't understand, can you help me more? i can send my file .aia

memorygame.aia (655.5 KB)

Can you send the block where you are using any component. And also the list associated with it

And where exactly does your error occur?

See the code here
Any_Component.aia (3.1 KB)

get an image of your blocks (→ right mouse click in Blocks area)

check your 2 selected_button variables, you initialized them using a create empty list block and forgot to assign a button component before using the verification procedure

use Do it to debug your blocks, see also tip 4 here
see also Live Development, Testing, and Debugging Tools

Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

como se asigna un componente de boton? es decir, que tengo que poner para que el error no salga

How is a button component assigned? that is, what I have to put so that the error does not appear



Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

sigue apareciendo el error

it looks like you forgot the other variable...


ahora aparece este otro

which means, your index in list block returns the value 0, because it could no find the item you are looking for, see also the documentation MIT App Inventor List Blocks

index in list

Returns the position of the thing in the list. If not in the list, returns 0.

btw. if variable1 always is button1 and variable 2 always is buton2 then it does not really make sense to use the advanced blocks...


entonces... perdona por ser tan pesado pero no entiendo que tengo que poner para que no me vuelva a salir este error

well... I also don't know...
you might have called your procedure twice?
the first time it worked and the 2 buttons have been removed from the list, then you called the procedure a second time and as the buttons already have been removed, you get the error, because they are not anymore in the list...
you might want to rethink your algorithms...