Message Path - bad behavior
Thomas J McGrath III
3mcgrath at adelphia.net
Sat Jan 10 10:55:15 EST 2004
I need some advice. Bear with me on this explanation. The issue is the
message path and openCard messages. Some times it does things
unexpectedly.
I have been tracking a problem with my stack. I have a main stack and a
bunch of substacks.
I set up the preOpenStack to handle some global variables and to set
the screenLoc.
I set up the preOpenCard to handle some handlers available in this
stack.
I also put a OpenCard in my stack script to handle specifics to this
stacks cards.
My problem is two fold:
1. Due to newness I put a pass Opencard in the openCard handler in my
main stack. When I push a button to open another stack from the third
card in my main stack the message goes to the main stacks opencard of
it's first card and not even to the openCard of the card I was on. This
has caused a weird glitch where the substack being called some times
goes behind the main stack when called via Go.
I eliminated the pass openCard in the main stack and now the message
path goes instead to the script of the card I am on.
Concerning the pass openCard:
It seems like the pass openCard that is at the lowest level is being
passed UP the line cause I press a button on card three and it goes
right down to the lowest level and then goes up the path finding
opencards. It should not do this.. It should only go down from button
to card it is opening and then down the line. (believe me that this is
happening and I think it is a bug or bad behavior at least)
The path "with the pass openCard in the main stack" when I select the
button on card three is: (the key here is card three)
Button on card three - pressed (go to stack "Whatever")
main stack - preOpenCard
main stack - OpenCard
Whatever stack - preOpenCard
Whatever stack - OpenCard
but sometimes it goes: (this should never happen)
card 1 of main stack - preOpenCard
card 1 of main stack - OpenCard
Whatever stack - preOpenCard
Whatever stack - OpenCard
The difference is that in the script of the main stack is a openCard
that is different then the one that is in card 1 of the main stack!!
Why cause I want certain things to happen all of the time via the main
stacks openCard and somethings I only want to happen when card 1 of the
main stack is opened!!
The path "without the pass openCard in the main stack" when I select
the button on card three is: (the key here is card three)
Button on card three - pressed (go to stack "Whatever")
main stack - preOpenCard
main stack - OpenCard
Whatever stack - preOpenCard
Whatever stack - OpenCard
Always happens....... It appears like sometimes it look in one place
and other times it looks else where. Meanwhile I didn't want it to look
there at all.
2. What do I do to stop the message path when in substacks from going
to handlers in the main stack. (I thought all I had to do was NOT pass
the message ie. do nothing except trap the message where I am at)
Would it not be better if there was a difference between the stack and
substack????? This way a substack would act more like a truly separate
window and things can be set up that are only specific to this substack
and not EVER related to the main stack UNLESS I program it to do so.
Like:
stack - preopenStack
stack - openStack
stack - preopenCard
stack - openCard
AND
substack - preopenSubstack (not related to the preopenStack and only
applies to the substack we are in)
substack - openSubstack (not related to the openStack and only applies
to the substack we are in)
substack - preopenCard - (but with no pass preopenCard then it does not
go to main stack anywhere)
substack - preopenCard - (with a pass preopenCard then it goes to the
main stack)
substack - openCard - (but with no pass openCard then it does not go to
the main stack anywhere)
substack - openCard - (with a pass openCard then it go to the main
stack)
Tom
Macintosh PowerBook G-4 OSX 10.3.1, OS 9.2.2, 1.25 GHz, 512MB RAM, Rev
2.1.2
Advanced Media Group
Thomas J McGrath III • 2003 • 3mcgrath at adelphia.net
220 Drake Road, Bethel Park, PA 15102
More information about the use-livecode
mailing list