This way it would be possible to send messages as "initialize" or "update" and let each object process it in its own way.
It could also make easier using OOP polymorphism and encapsulation using the new Rev 3.5 Behaviours.
I'm actually doing it this way:
Code: Select all
on sendToAll pMsg -- send a message + n params to all the card controls
-- pMsg format: message param1,param2,..
local msgData,tHeader
put pMsg into msgData
if the paramCount > 1 then
   repeat with x=2 to the paramCount
     if x=2 then put " " into tHeader
     else put "," into tHeader
     put tHeader & param(x) after msgData
   end repeat
 end if
 repeat with i=1 to the number of controls in this card -- all the card controls
   try -- no error if the control doesn't exists
     send msgData to control i
   end try
 end repeat
end sendToAll
It could also be useful to have a "sendToGroup" message, to reach the objects of a group only.
You can download a Revolution example (a timer) on
http://www.mariomiele.it/downloads/
best regards,
Mario Miele
________________
e-voluzione
http://www.e-voluzione.it/