Behavior Nightmare

David Bovill david.bovill at gmail.com
Mon Feb 15 17:51:49 EST 2010


On 14 February 2010 23:55, Scott Rossi <scott at tactilemedia.com> wrote:

> The following works on my end and appears to operate counter to what you
> say.
>
> - Create new stack "maintest".
>
> - Create substack of maintest named "subtest".
>
> - Create a button in stack subtest named "b1".  Script:
>  on mouseUp
>   answer theMsg()
>  end mouseUp
>
> - Create another button in stack subtest named "b2".  Script:
>  function theMsg
>   return "abc 123"
>  end theMsg
>
> - Go back to stack maintest.  Set the behavior of the current card to long
> id of btn b1; set the behavior of stack maintest itself to long id of btn
> b2.
>
> Click the card in the main stack.  You should see the "abc 123" message
> above.  Note the script will fail if you remove the behavior assigned to
> the
> main stack or the card in the main stack.
>
> If behaviors are indeed essentially object-level backscripts, then I think
> it makes sense that object-level behaviors "fall through" to
> card/stack-level behaviors -- this is consistent with card/stack scripts
> handling any messages that go unhandled by objects.
>

I don't follow - the example is it not just what you would suspect - just
like putting the scrpts in the card and stack script? I don't see what you
mean by "fall through"

card --> btn 1 of stack subtest ( = backscript of card)
   |
   v
stack --> btn 2 of stack subtest ( = backscript of stack)



More information about the use-livecode mailing list