Click Event extension for any components

35 views
Skip to first unread message

Ashutosh Sharma

unread,
Apr 1, 2018, 3:23:08 PM4/1/18
to App Inventor Open Source Development

Hi There,
I am trying to create an extension that takes component as the parameter and adds onclick event to that component. Can anyone help me to achieve this. I have developed an extension, it takes component as parameter and I have a simpleevent with eventdispatcher.dispatchEvent(component, “Click”); but the click event is not working.:thinking:

Evan Patton

unread,
Apr 3, 2018, 3:25:08 PM4/3/18
to App Inventor Open Source Development
Are you trying to dispatch the Click event on the component or on the extension? If the component lacks a "Click" event definition, then it will not do anything and there won't be an associated block. If you are trying to dispatch the click event on the extension, then you probably want to replace "component" in your code with "this", so that you dispatch on the extension instance rather than the component.

Regards,
Evan
Reply all
Reply to author
Forward
0 new messages