On 9/7/2014, 3:55 PM, William Prothero wrote:
I understand that if a stack is opened, then the preOpenStack handler
is triggered (it is in the first card), but if I go to another card
on the same stack with a different preOpenStack handler on it, I
would assume the preOpenStack handler wouldn’t get triggered because
a new stack hasn’t been opened. Easy to test, but I thought I’d ask.

Right. The preOpenStack and openStack messages are only sent once when a stack first opens. It always opens on the first card. As a user you won't see that if a script requests "card 2 of stack x" but it still goes to card 1 first and then moves to card 2. I don't believe a preOpenStack handler on card 2 will ever trigger.

It seemed non-intuitive to me too that you could put a preOpenStack handler in a card, because the card wasn't open yet. That was wrong-thinking. I asked Mark Waddingham about it some years ago and he said that the entire stack has to load at once when it opens, otherwise there would be no way a script could manage any of the objects or card properties. The messages are sent in a specific order, but in reality the entire structure is already in RAM before the messaging starts.

--
Jacqueline Landman Gay         |     jac...@hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com


_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to