disable command

Eric Chatonet eric.chatonet at sosmartsoftware.com
Fri Nov 18 13:25:24 EST 2005


Hi Nicolas,

I agree Jacque's answer except on one point :-)
I would prefer something like the following where the whole code is  
in the card's script and then easy to maintain:

on mouseUp
     if "image" is in the target then
     switch the short name of the target
     case "Img1"
       -- do some stuff
       break
     case "Img2"
       -- do another stuff
       break
       -- etc
     end switch
   end if
   -----
   put flushEvents("mouseUp") into temp
end mouseUp

The last line in the handler prevents any mouseUp being triggered  
while another mouseUp is running.

Best Regards from Paris,

Eric Chatonet.

Le 18 nov. 05 à 18:16, J. Landman Gay a écrit :

> Nicolas Cueto wrote:
>> An hour or two of debugging but...
>> My card has 16 images, each with
>> a mouseUp script. I only want one
>> script to run at a time. So, within
>> the mouseUp script of each image
>> I added calls to lock/unlock handlers
>> contained in the card script, i.e.,
>
> I don't think I would do it this way. Instead, I would put a single  
> "mouseup" handler in the card script and test for "the target".   
> Name each image consistently, for example, "mazeImg1", "mazeImg2",  
> etc. Then you can do something like this:
>
> on mouseUp
>  if the short name of the target contains "mazeImg"
>  then send "doMazeStuff" to the target
>  else pass mouseUp
> end mouseUp
>
> Each image would have a handler called "doMazeStuff" that controls  
> its behavior -- just like what your mouseUp handlers are doing now.
>
> If a user clicks on several images in order, their scripts will run  
> sequentiallly, so that shouldn't be a problem, right?
>
> -- 
> Jacqueline Landman Gay         |     jacque at hyperactivesw.com
> HyperActive Software           |     http://www.hyperactivesw.com

----------------------------------------------------------------
So Smart Software

For institutions, companies and associations
Built-to-order applications: management, multimedia, internet, etc.
Windows, Mac OS and Linux... With the French touch

Free plugins and tutorials on my website
----------------------------------------------------------------
Web site        http://www.sosmartsoftware.com/
Email        eric.chatonet at sosmartsoftware.com/
Phone        33 (0)1 43 31 77 62
Mobile        33 (0)6 20 74 50 86
----------------------------------------------------------------




More information about the Use-livecode mailing list