Alice Community  

Go Back   Alice Community > Alice 3 > How Do I?

Reply
 
Thread Tools Display Modes
Clicking on object to call for help
Old
jtljmeyer
Member
 
Status: Offline
Posts: 19
Join Date: May 2012
Location: Iowa
Default Clicking on object to call for help - 11-02-2012, 06: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?
   
Reply With Quote
Click on object
Old
djslater107
Administrator
 
Status: Offline
Posts: 144
Join Date: Jan 2007
Default Click on object - 11-02-2012, 10: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!
Attached Images
File Type: jpg clickOnObject.jpg (19.6 KB, 17 views)


Don Slater
Alice Team
Carnegie Mellon University
   
Reply With Quote
Old
jtljmeyer
Member
 
Status: Offline
Posts: 19
Join Date: May 2012
Location: Iowa
Default 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
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



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