Testing if the mouse clicked on ME (button)?!

H Baric hbaric at gmail.com
Sat Aug 9 10:19:44 EDT 2008


Ugh. Sorry for another probably easy/obvious one to you clever folk, but I 
can't seem to work out how to do this (and probably shouldn't be at this 
time as I'm just about falling asleep, but it's driving me crazy as it was 
supposed to be a quick simple thing to do):

Making a timer, with just one button and one field.
The one button is to start and stop the timer.
The button's label is changed to "Stop" when it starts, and "Start" when it 
stops. I think I got that?
But, how to test when the user clicks on the button during the process? 
(sorry, hey don't laugh! I have been searching and trying everything I know, 
which isn't much yet!)

But it's simple right? *blush*

Here goes:

on mouseUp
    if the label of me is "Start" then
        set the label of me to "Stop"
        repeat with tCount = 1 to 60
        put tCount into fld "Counter Show"
        wait 1 second
        if (I am clicked??) and the label of me is "Stop" then
            exit repeat
            set the label of me to "Start"
        end if
        end repeat
    end if
end mouseUp

Cheers,
Heather - Who's toddler and teenager messed with most of her brain cells 
today. 




More information about the use-livecode mailing list