Flushing the "flushEvents" command...

Phil Davis davis.phil at comcast.net
Mon Feb 23 13:47:25 EST 2004


The way your code is right now, if the user clicks outside the rect of the
group, the group won't receive the message.

One way to get the effect you want:
You could use a frontscript that is only inserted while the popup group is
visible. It would look like this:

on mouseDown
  if the mouseLoc is within the rect of group "popup" then
    pass mouseDown
  else
    Get flushEvents("all")
    Beep
  end if
end mouseDown

This way you can make mouseDown ineffective unless it happens inside your
popup.


HTH -
Phil Davis



----- Original Message -----
From: "m" <mlindley at telusplanet.net>
To: <use-revolution at lists.runrev.com>
Sent: Tuesday, February 24, 2004 9:12 AM
Subject: Flushing the "flushEvents" command...


Ok, here's my problem: in my app I have groups that pop-up (not
stacks.groups that include graphics, buttons, fields, etc.) but they are
much smaller than the full window.  I don't want the user to be able
click outside the area of the popped-up group until that group's actions
are completed.  I've been trying several things, all of which don't seem
to be working.

It would seem to me that using "flushEvents" should solve this problem,
but my app just seems to ignore this command and allow the user to click
where ever he/she wants.

Here is an example of my problem (I place this script in the popped-up
group's script):

On mouseDown
            If the clickLoc is not within the rect of me then
                        Get flushEvents("all")
                        Beep
            End if
End mouseDown

The problem seems to persist even if I replace "clickLoc" with
"mouseLoc."  What am I doing wrong with this?  Am I using this command
properly?  Is there an easier way to solve this problem?

I've been trying to use the "exit mouseDown" command [or mouseUp.
whatever] to interrupt the user's click, but it seems to be ignored too.
I'm not sure what I'm doing wrong with this.

Here's my temporary workaround. I use a cumbersome if.then statement in
the Card script to identify if the group's "visible" is true or not.  If
it is then I just hide the popped up group if the user clicks outside of
it.  Obviously, that's not the smartest way to go.  Help!
_______________________________________________
use-revolution mailing list
use-revolution at lists.runrev.com
http://lists.runrev.com/mailman/listinfo/use-revolution



More information about the use-livecode mailing list