I came across an interesting problem, and Kevin helped me solve it (thanks,
Kevin!) so I thought I would post the solution here.

The problem is the way background messages get passed when you have more
than one background/group on a card. That's openBackground, closeBackground,
and preOpenBackground. They go to the card first, and then to each
background in turn, from highest to lowest, and then on up through the
stack(s). Regardless of which background is opening/closing, they all get a
shot at it. The target is the card, so how do you know _which_ background is
opening or closing?

The answer Kevin gave me was that these messages actually have a parameter,
which contains the id of the background that caused the message. So
something like the following will do the trick:

on openBackground whichOne
  if whichOne is the id of me then
    --the background containing this script
    --caused the message. Do stuff here
  else
    --this background didn't cause the message;
    --let something else handle it
    pass openBackground
  end if
end openBackground

Regards to all,

Geoff Canyon



Archives: http://www.mail-archive.com/metacard%40lists.best.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.

Reply via email to