Clicking components

Is there any way to identify a clicked component without having to actually code the component ID? I have 8 labels with different ID's. For click events I have to use an if statement on each one of them to determine which one was clicked. This is messy to say the least. Am I missing something here or is that the way MIT App works? I would have though clicking on a comoponent and changing its color for example could be handled by grabbing the 'component' property in the Click event so all I would need is one one block of code that would work on any component such as labels. As it stands now I have to write an if statement for each label. Surely there must be a better way to code this than what I am using?

You should be able to use an "Any Component" Block with a For loop.

What kind of control is that: "Any Component" I don't see it.

It's in the Blocks List:

I'm sorry but I don't have it. I opened every tool folder and I do not see it. Do I have to do something or configure something in order to see it?

I don't see the Blocks list. Mine says User Interface.
My url is: https://ai2.appinventor.mit.edu
Maybe that's the problem?

See the sample code in

URL is correct.... it absolutely should be there. Did you start this Project in an earlier version of App Inventor? If so, did you choose the 'level' of components and blocks available -it was supposed to allow schools to introduce App Inventor in stages of increasing complexity - looks like that has been withdrawn in the latest release.

Is didn't know about the starting levels. I've been using MIT for about 2 weeks or so. I'll see if I can change my level,

In Project Properties, I set every one of the selections and none of them showed the Blocks area, So maybe that has been removed too?

Set the toolkit to Default in the project properties
Taifun

ProjectProperties

An example using the free ClickZ extension:

Example_AnyComponent.aia (10.2 KB)

I see it now. Thank you for the help!!

you are now in designer view, you need to change to blocks view.