View Full Version : Clicking on object to call for help

11-02-2012, 07:16 AM
In my program,I am trying to click on the mad hatter and have him pull up a help menu. I tried using the addMouseClickOnObjectListener, but there doesn't seem to be an option to click on the hatter. Can I do what I want? If so how?

11-02-2012, 11:13 AM
See the attached screen shot from an Alice 3.1 project (using an alien instead of the hatter).

1) Create your event in the InitializeEventListeners method.
2) Clicking on the Add Event Listener button, and choose Mouse -> AddMousceClickOnObjectListener
3) Drag an if-control into the event code block. Select true as the default.
4) Replace the true (using the drop down menu), by choosing Relational (SThing) {==, !=} option.
5) select the (??? == ???) option, using the hatter for both options.
6) drag the {e getModelAtMouseLocation) parameter to replace one of the hatters in the == expression.

Good luck!

11-02-2012, 11:35 AM
I followed your instruction. Nothing is happening. Is this feature enabled? I ran it both in 3.1.48 and 3.1.49