Hi all,
I have a mouseclicked function in a component
You cannot (well, not easily).
Move the code to a project script. Call that project script from both events.