Splash snafu

Ken Ray kray at sonsothunder.com
Tue Dec 23 15:22:30 EST 2003


> OK. I guess I haven't seen it before because there has been a handler in the
> substack. I suppose RR first looks to find an openCard handler and runs to
> the parent to find one if none exists. I've seen this before in other
> xTalks, so I should have recognized that it would fall through.
> -----------
>> Solution:
>> 
>> put a generic "openstack" handler into the substack like:
>> 
>> on openstack
>> ###
>> end openstack
> -----------

One other solution is to put into the mainstack the handler that says:

on openStack
  if the owner of the target is me then
    -- it's running the openStack for the mainstack
  else
    -- it's running the openStack from a substack that didn't
    -- trap the openStack handler
  end if
end openStack

"the target" in this case is the card, so the "owner of the target" is
either the substack or the mainstack (depending on which got the message).
By checking if "the owner of the target is me", it ends up determining if
the target of the message is the card of the *mainstack* - if so, it does
its thing. If not, the target of the message is the card of a *substack*,
and it can effectively be ignored (or trapped and managed).

Just my $0.02,


Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com



More information about the use-livecode mailing list