> I'm sure I'm doing something dumb but I can't get
> something to work.  I am creating a program that will
> place a spot in one of several locations in one of
> four colors whenever someone clicks the mouse button.
> I want this to happen 5 times and then I want the loop
> to stop.  My loop changes the location and color 5
> times for each mouse click and I want one mouse click,
> one change.

Not dumb, just a bit of flawed logic. MouseDown is an event. "On mouseDown"
means, "one click". So, what you are doing is looping five times on a single
mouseDown... what you need is a flag, or counter, in your behavior that will
stop the action at five mouse clicks.

In other words, add a property to your behavior that will store mouse clicks
for you. Add this to your code:

property pClicks

on mResetClickCount me
  pClicks = 0
end

on mouseDown me
  if pClicks < 6 then
    pClicks = pClicks + 1
    --All of your other code
  end if
end


This will deactivate the behavior after five clicks. You can then reactivate
it by sending the mResetClickCount() call.

-Kurt



[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to