Hi Guys,
Hopefully a simple question, I have a card with many objects placed in various positions. When I highlight the object, I want to obtain the top location of the object.
I thought the following command (which I'm typing in the message box) would help me obtain the top location of the object, if I have it selected.
answer the top of me
However this produces 507 regardless of which object is highlighted. Anyone point me in the right direction please, tried top,left etc but they all produce same values on different objects on the card.
Thanks as always Jalz
top location of object
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Livecode Opensource Backer
- Posts: 447
- Joined: Mon Jan 23, 2012 12:46 pm
Re: top location of object
I think what you're looking for is something like this:
--Sefro
Code: Select all
answer (item 2 of the rect of me)
--Sefro
Re: top location of object
If you ask for the top (or anything) of "me" in the message box, well, wait a minute. You can do this yourself.
try this in the message box:
Now lets get going on learning about object references. Please read in the dictionary: "target". "me", "selectedObject".
What you want to do is to make sure the line of code makes sense to LC. If you think about it, how would the message box know which object you had in mind? The items above are powerful xTalk gadgets, but mostly, you will lay out explicit object references.
Write back with your thoughts...
Craig Newman
try this in the message box:
Code: Select all
answer the name of me
What you want to do is to make sure the line of code makes sense to LC. If you think about it, how would the message box know which object you had in mind? The items above are powerful xTalk gadgets, but mostly, you will lay out explicit object references.
Write back with your thoughts...
Craig Newman
Re: top location of object
Thanks to both for replying,
Craig, I thought I was going mad, of course I should have realised I was in the context of message box - duh
I'm now targeting the top of the fields, and all is good.
Jalz
Craig, I thought I was going mad, of course I should have realised I was in the context of message box - duh

I'm now targeting the top of the fields, and all is good.
Jalz