disable command

Klaus Major klaus at major-k.de
Fri Nov 18 11:13:39 EST 2005

Hi Nicolas

> 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.,

Maybe using a global flag would help?
If yes this would require only a "mouseup" handler :-)

> -- image's script
> on mouseUp
> ...
> end unlockMaze
> However, even though I thought
> this'd disable all the images, they
> remain clickable.
> My guess? Because I'm disabling
> all 16 images, which includes the image
> that should be running, this is somehow
> interfering.

Strange but possible...

> If so, what's a way of preventing the
> mouseUp scripts of the other images
> from being activated?

Try this:

-- image's script
on mouseup
   global prevent_click
   ## should be set to "false" at startup
   if prevent_click = false then
     put true into prevent_click
     ## prevent click :-)
     do some other stuff
     ## after some other stuff has finished
     put false into prevent_click
   end if
end mouseup

No need to disable the images.

Hope that helps.

> Thanks.


Klaus Major
klaus at major-k.de

More information about the Use-livecode mailing list