Barry,

try..

on centerTheObject pObject --pObject is the name of the object to be
centered
   set the loc of pObject to the loc of this cd
end centerTheObject

this has the advantage of not using a global variable.

Of course, even easier (as Ken suggests) is to just say:

set the loc of fld "fred" to the loc of this cd

done in only one statement...in this case I probably would not create a
handler for it, just put it inline with the code calling this.

-Chipp

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of Barry Levine
> Sent: Monday, August 11, 2003 8:42 PM
> To: [EMAIL PROTECTED]
> Subject: Centering an object in a window
>
>
> I'm not sure if this is the proper method but it worked so I thought
> I'd post it.
>
> on centerTheObject
>    global theObject
>    set the loc of theObject to (item 1 of the localloc of the loc of
> this stack) ,\
>       (item 2 of the localloc of the loc of this stack)
> end centerTheObject
>
> In the script that calls the above, I use:
>
> put myObject into theObject
> -- "myObject" for example being "field m144" (using quotes)
>
> Hope this helps someone.
>
> Regards,
> Barry
>
> _______________________________________________
> use-revolution mailing list
> [EMAIL PROTECTED]
> http://lists.runrev.com/mailman/listinfo/use-revolution
>

_______________________________________________
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to