Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
How do i get a variable to tell me if a function is running or not
Old
rohan123444
Guest
 
Status:
Posts: n/a
Default How do i get a variable to tell me if a function is running or not - 11-18-2009, 07:26 PM

I have to make this program that when you click on an object someone points to it and a method runs. Now the problem is that if you click on another object before the method finishes running then it will mess up the entire program. I need help on finding a way so that if the mouse is clicked while this method is running do not do anything. That is basically what i need help on.
   
Reply With Quote
Old
reuben2011
Senior Member
 
reuben2011's Avatar
 
Status: Offline
Posts: 489
Join Date: Sep 2009
Location: Hawaii
Default 11-18-2009, 08:30 PM

It seems like your clicking the 2nd object while the 1st method from the first object is still going. To fix this, put all your click methods in a big if/else statement in the if section. Make a new boolean variable in the world, name it something, set its default to true. Now for all the if/else statements, drag the variable you just made in the condition part of the if/else statement (the very top). Click the down arrow, and go to the equals sign and click true. Now in all the click methods in the beginning set the variable you made to true and at the end set the variable you made to false. Hope this helps.
   
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 ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.