Alice Community  

Go Back   Alice Community > Alice 2 > Bugs and Troubleshooting

Reply
 
Thread Tools Display Modes
Object under mouse None problem
Old
dejohnso
Guest
 
Status:
Posts: n/a
Default Object under mouse None problem - 06-25-2009, 01:20 AM

Hi,

I am using Alice 2.2 We are using the "when the mouse is clicked on anything, do clickedMethod, clickedThing = objectUnderMouse"

If the sky is clicked on, it sends a None object to the clickedMethod, which causes a crash. I seem to recall fixing this is 2.0 by using the expanded "during" option, but that doesn't seem to work here.

We attempted to work around that by putting acceptable objects in a list, and using

if acceptableObjects contains clickedThing, then do the behaviour.

But the "contains" function did not seem to work as far as I can tell.

Any suggestions?

I did create one horrible workaround. I made a local variable "emptyList", which is a list of objects, populated with None. I can now compare

if clickedThing != first item from emptyList then do the behaviour.

But I would prefer not trying to explain that to our camp of middle schoolers. So if there is a more rigorous way of avoiding this issue, I would appreciate it.

Thanks,
David
   
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 ©2020, Carnegie Mellon University
Alice 2.x İ 1999-2012, Alice 3.x İ 2008-2012, Carnegie Mellon University. All rights reserved.