Weirdness Passing Messages

David Burgun dburgun at dsl.pipex.com
Wed Mar 22 13:51:46 EST 2006


Hi,

I have a 2 Stacks, StackMain and StackUtil. I used StackUtil as a  
"library stack" via the start using command.

In the Stack Script for StackUtil I have the following functions:

PutMessage()
ListenForMessages()

In StackMain Card 2 ObjectX, I do:

function InitObject
get ListenForMessages("MessageX")
end InitObject

on MessageX
put "MessageX" into me
get PutMessage("MessageY")
end MessageX

on mouseUp
put "MessageX" into me
get PutMessage("MessageY")
end mouseUp


In StackMain Card 2 ObjectY, I do:

function InitObject
get ListenForMessages("MessageY")
end InitObject

on MessageY
put "MessageY" into me
end MessageY


In StackMain Card 2 ObjectA, I do:

on mouseUp
get PutMessage("MessageX")
end mouseUp


If I press the button associated with Card 1 Object, then MessageX  
gets called in Card 2 ObjectX ok and ObjectX gets set to "MessageX".  
All is fine. MessageY in Card 2 ObjectY gets called ok too, BUT the  
field is NOT set to "MessageY" as expected????? However if I press  
the button associated with Card 2 ObjectX, again the MessageY in Card  
2 ObjectY gets called AND the field is set ok. All is fine.

The message passing has been tested and it works fine in general, but  
it seems like the following path does not work:

Card1:ObjectA:mouseUp -->Card2:MessageX:Card2:MessageY does not work.

But

Card2:ObjectX:mouseUp -->Card2:MessageY works ok.

The weird thing is that the handlers do get called and I have stepped  
over the statement that does:
put "MessageY" into me and that seems to work. However, when you  
select card 2, the field has not been changed.

Any Ideas???
Thanks in Advance
All the Best
Dave









More information about the Use-livecode mailing list