closeField - Curious

Robert Brenstein rjb at robelko.com
Sun Dec 19 19:04:29 EST 2010


On 18.12.2010 at 23:02 Uhr -0600 J. Landman Gay apparently wrote:
>If you can't find the reason in your scripts, it might have to do 
>with the message hierarchy. I've hit the same snag before and ended 
>up adding a check for "the selectedfield" at the top of the button 
>script that navigates. I.e.:
>
>  if the selectedfield is not empty
>  then send "closefield" to this card
>
>What I think could be happening is that the button gets a mouseup, 
>the engine sends a few automatic messages like closefield as needed, 
>then the button executes it's own script. Only one handler can 
>execute at a time, so by the time the closefield passes to the card, 
>the card has already changed and there is no closefield handler 
>there to catch the message. Or if it does have one, you get the 
>second card's closefield handler activating instead.
>
>At least, that's how it looks.
>
>--
>Jacqueline Landman Gay         |     jacque at hyperactivesw.com
>HyperActive Software           |     http://www.hyperactivesw.com


I can second this. I was hit a number of times by scripts executing 
on the wrong card when user action changed card. This has also to do 
with the order messages are sent and executed. Some times it is 
reasonable and possible to avoid actually changing the card but 
rather redesigning the stack so the card changes without a physical 
move to another card.

Robert




More information about the use-livecode mailing list