problem positioning a sub stack using globalLoc

Klaus Major klaus at major-k.de
Tue Aug 26 15:01:02 EDT 2003


Hi Chris,

> I have a sub stack that I want to open when a user clicks on a list of
> words.  I'm trying to position the sub stack right over the top of 
> this list
> of words, which are in a group called "Key Words".  Obviously I can't 
> use
> the location of that group, since it's relative to the main stack and 
> not to
> the screen.  So I thought I'd try the globalLoc function, which seems 
> to
> return the correct value when used in the Message Box, but not when I 
> use it
> in a script.  I copied and pasted this line of code
>
> put the globalLoc of (the loc of grp "Key Words" of cd "Prediction" of 
> stack
> "RNStories")
>
> directly from my script into the message box, and the returned values 
> are
> not consistent.
>
> Is there a better way to do this?  How can I set the loc of a sub 
> stack so
> that it covers an object in my main stack?

What about:

...
set the bottomleft of stack "substack you like to place" to \
          globalloc(the topleft of fld "listfield" of cd 1 of stack 
"XYZ")
...

Works fine here :-)

Hmmm, putting things on top of each other...
Does anyone remember this Monty Python sketch?
LOL... :-)

> Thanks,

You're welcome...

> Chris Sheffield
> Software Development
> Read Naturally
> csheffield at readnaturally.com

Regards

Klaus Major
klaus at major-k.de
www.major-k.de




More information about the use-livecode mailing list