alice-teacher Event Listeners and Handle Active Command in Alice 3.1

James Vanderhyde jvanderhyde at benedictine.edu
Wed Oct 1 12:25:33 EDT 2014


2)
One way to do this is to have a boolean variable to control access in the event listener code. In your example, you can have a variable called “moveBoxAllowed” initially set to true. When the later point in the program is reached, set it to false. In the event handler code, put the box movement code inside an if block that checks the moveBoxAllowed variable.

James
--
Dr. James Vanderhyde
Math and Computer Science
Benedictine College
jvanderhyde at benedictine.edu<mailto:jvanderhyde at benedictine.edu>
http://vanderhyde.us/~james/pro/



On Oct 1, 2014, at 8:39 AM, Emily Higgins <erphiggins at gmail.com<mailto:erphiggins at gmail.com>> wrote:

Dear All-
 I have two questions.
1)  What does the Handle Active command do in Alice 3.1?
2) How can you set up a program so that an object is only affected by an event listener for part of the program?  For example, a student wants to have the program user move a box but only at a certain point of the program.  I can't figure out how to limit when an event listener is active.

Thank you,
Emily Higgins
Boothbay Region High School
Boothbay Harbor, Maine
_______________________________________________
alice-teachers mailing list
alice-teachers at lists.andrew.cmu.edu<mailto:alice-teachers at lists.andrew.cmu.edu>
https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20141001/0e89a988/attachment-0001.html 


More information about the alice-teachers mailing list