Repeat until the MouseClick to stop 'flashing' button?

Mark Wieder mwieder at ahsoftware.net
Tue Jun 8 16:23:49 EDT 2010


William-

Tuesday, June 8, 2010, 1:14:16 PM, you wrote:

> @ Mark: easier to read now?

> Hi there,

> I have a flashing button "1"  with this script:
> on mouseUp
> set the backgroundcolor of grc "dummy" to pink
>      repeat
>     hide me
>     wait 25 ticks
>   show me
>   wait 25 ticks
> end repeat
> end mouseUp

> The idea is that while button "1" is flashing I want to click at
> button "2"  so button "1" stops flashing and executes its own script:
> on mouseUp
>    set the backgroundcolor of me to the backgroundcolor of grc "dummy"
> end mouseUp

> I try adding 'repeat until the MouseClick' in button "1" but that only
> stops the flashing (what I want) but doesn't execute the script in
> button "2".
> To run the script on button "2" I have to click on button "2" again.
> So I have to click twice and that is not what I want :-(.

> Is this possible?
> Anyone has any other idea's on how to do this?

Yep - that's much better. Lots of ways to do this. Here's one:

button1:

on mouseUp
  set the IsFlashing of me to true
  send "flashme" to me in 25 ticks
end mouseUp

on flashme
  if the IsFlashing of button 1 then
    if the visible of me then
      hide me
    else
      show me
    end if
    send "flashme" to me in 25 ticks
  end if
end flashme


button 2:

on mouseUp
  set the IsFlashing of button 1 to false
end mouseUp

-- 
-Mark Wieder
 mwieder at ahsoftware.net




More information about the Use-livecode mailing list