Page 1 of 1

Dynamic Path?

Posted: Fri Jan 09, 2015 4:03 pm
by uelandbob
I create a stack with two cards called "RedCard" and "GreenCard"

On the RedCard i make a button called "TestButton" and make its script look like this

Code: Select all

on mouseUp
   go card "GreenCard"
   doMyHandler
end mouseUp
I make the script of the GreenCards look like this

Code: Select all

on doMyHandler
   put "doMyHandler trapped"
end doMyHandler
When I run this in HyperCard everything works and I get "doMyHandler trapped" written in the message box.
However it does not work in LC. It says that button "TestButton": execution error at line 3 (Handler: can't find handler) near "doMyHandler", char 1

So thus this mean that LC doesn't support dynamic paths, or have I done some simple error?

Re: Dynamic Path?

Posted: Fri Jan 09, 2015 4:24 pm
by Dixie
mmm... it does work if you put the 'doMyHandler' handler in the script of the stack...

but, if you read the user guide...
"Caution: If a stack's dynamicPaths property is set to true, message handlers in that stack use HyperCard's dynamic path behavior: if a handler uses the go or find command to go to a card other than the original card, that destination card's message path is inserted into the message path as long as the handler is on that card. The dynamicPaths property is provided for compatibility with imported HyperCard stacks, and is normally set to false, but you may encounter this behavior when working with a stack that was originally created in HyperCard."

Re: Dynamic Path?

Posted: Fri Jan 09, 2015 4:46 pm
by uelandbob
Dixie wrote:The dynamicPaths property is provided for compatibility with imported HyperCard stacks, and is normally set to false, but you may encounter this behavior when working with a stack that was originally created in HyperCard."
Thanks Dixie, that was it :D
I executed the following statement in the msg box

Code: Select all

set the dynamicPaths of this stack to true
and then everything worked. So, it seems that someone thought that dynamic paths was a bad idea and kept it only for compatibility. I wonder what the reasoning behind that decision was? Maybe dynamic path confused people; You can put the on doMyHandler in the RedCard's script and then everything works, and IS less confusing. If I was in charge I would probably have dumped it as well.