Hi Fabricio,


I need my script execute the handler mouseDown first. In this script (a big
script) some variables are setting for, after, when all script for this
handler is finished, the script mouseUp is called. In another words:

You could try to set a couple of property flags to know if your handler
routine is over, like something like this

-- untested behavior code
property pbMouseDownHandlerFlag
property pbMouseUpHandlerFlag

on beginSprite me
    -- your other stuff here
    -- ...
    pbMouseDownHandlerFlag = False
    pbMouseUpHandlerFlag   = False
end -- beginSprite

on mouseDown me
   pbMouseDownHandlerFlag = False
   -- your mouseDown handling stuff here
   -- ...
   pbMouseDownHandlerFlag = True -- pbMouseHandlerFlag is True only when
                            -- your mouseDown script as executed totally
end -- mouseDown

on mouseUp me
   pbMouseUpHandlerFlag = True
   -- your old mouseUp script has move to an idle script
end -- mouseUp

on idle
   if (pbMouseUpHandlerFlag AND pbMouseDownHandlerFlag) then
      -- do your old mouseUp script
      -- ...
      pbMouseUpHandlerFlag   = False
      pbMouseDownHandlerFlag = False
   end if
   -- your other idle script
   -- ...
end -- idle

Please note that the idle script may not be the best place to put your test,
you can also use a defined handler, called by the mouseUp, which test the 2
flags until they meet the conditions as in the idle script above. In this
case you should add a timer test, 'cause you have no warranty the mouseDown
script terminate properly, this problem  could make your test looping forever.

in this case your beahvior should look like this :
on mouseUp me
   pbMouseUpHandlerFlag = True
   mouseEndingClic
   -- your old mouseUp script has move to an idle script
end -- mouseUp

on mouseEndingClic
   -- called by the mouseUp handler
   lLoopStartTime = the milliseconds
   repeat while not(pbMouseUpHandlerFlag) AND �
pbMouseDownHandlerFlag AND �
((the milliseconds - lLoopStartTime)/1000)<3)
      nothing -- loop 'til the mouseDown handler is finished
   loop
   -- do your old mouseUp script
   -- ...
   pbMouseUpHandlerFlag   = False
   pbMouseDownHandlerFlag = False

end -- mouseEndingClic
-- end of untested behavior code

Hope this helps,
S�bastien



[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