Send a message to all controls on a card [sidenote]

Malte Brill malte.brill at t-online.de
Fri Sep 17 07:50:37 EDT 2004


Hi,

just as a sidenote I have learned when I experimented with creating a
breakout game in Rev.

If you have many controls on your card it could be a good idea to store the
abbr ID of your controls in a custom property and use the repeat for each
form to speed things up.

e.g.:

on collectEmAll
--call this handler to collect all your controls in a cProp
  repeat with i=1 to the number of controls of this cd
    put the abbr ID of control i&cr after myControls
  end repeat
  delete char -1 of myControls
  set the allControls of this cd to myControls
end collectEmAll


on mouseUp
--very speedy
  repeat for each line daControl in the allControls of this cd
    send myMessage to daControl
  end repeat
end mouseUp

Best,

Malte



More information about the use-livecode mailing list