Object paths?
Richard Gaskin
ambassador at fourthworld.com
Tue Jul 20 23:47:54 EDT 2004
Ken Ray wrote:
> The defaultstack is always what is returned by the topStack() function,
> unless it is set specifically to some other stack via script.
Not quite: the defaultStack is the stack in the current message path,
but can be set to point to any other stack to allow incomplete
references to objects in that stack.
For example, when a button is clicked, the defaultStack is the stack in
which the button object is located, but if you set the defaultStack to
another and ask for "the name of btn 1", what you'll get is the name of
the first button in that other stack.
Try this - make a new stack, add a button with this script:
on mouseUp
put the defaultStack &cr& the topstack
end mouseUp
Then set the style of the stack to palette, create another new stack as
toplevel, and click the button in the palette stack.
What you should see is line 1 of the message box will contain the name
of the palette stack in which the button was clicked, but line 2 will
contain the name of the second, toplevel, stack.
--
Richard Gaskin
Fourth World Media Corporation
___________________________________________________
Rev tools and more: http://www.fourthworld.com/rev
More information about the use-livecode
mailing list