the dynamicPaths

Timothy Miller gandalf at doctorTimothyMiller.com
Sun Aug 28 22:38:14 EDT 2011


Hi Ken,

I get it. Thanks a bunch.

Tim

On Aug 28, 2011, at 5:49 PM, Ken Ray wrote:
> 
> I looked this up to be sure (Jean DeVoto's got a diagram and explanation of the dynamic paths on this page: http://www.jaedworks.com/hypercard/HT-Masters/scripting.html - go to the section called "The Message Path"), but basically it goes like this:
> 
> Imagine you have a stack with two cards, and a button the first card. 
> 
> The script of card one is empty.
> 
> The script of card two is:
> 
> on DoIt
>  answer "I'm on card 2"
> end DoIt
> 
> The script of button on card 1 is:
> 
> on mouseUp
>  go card 2
>  DoIt
> end mouseUp
> 
> In HyperCard (or if the dynamicPaths property is true in LiveCode), you'll click the button, go to card 2 and the answer box will say "I'm on card 2". If the dynamicPaths is false (the default) and you click the button, you go to card 2, but then get a "can't find handler" error dialog. This is because with the dynamicPaths turned *off*, LC will look in the normal message path (from the button you clicked's perspective) to find the handler "DoIt". Since it's not in the script of card 1 or in the stack script, you get the error dialog. Turn it on, and card 2's script hierarchy (card/background/stack) is inserted *between* the stack script and the libraries/backscripts/engine. So this would mean the message would go:
> 
> button 1 -> card 1 -> background(s) -> stack -> card 2 -> background(s) -> stack -> libraries/backscripts/etc -> Engine
> 
> Hope I have this right...
> 
> Ken Ray
> Sons of Thunder Software, Inc.
> Email: kray at sonsothunder.com
> Web Site: http://www.sonsothunder.com/	




More information about the use-livecode mailing list