Alice Community

Alice Community (
-   How Do I? (
-   -   Clicking on object to call for help (

jtljmeyer 11-02-2012 06:16 AM

Clicking on object to call for help
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?

djslater107 11-02-2012 10:13 AM

Click on object
1 Attachment(s)
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!

jtljmeyer 11-02-2012 10: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

All times are GMT -5. The time now is 03:00 AM.

Copyright ©2018, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.