target | |||||||
Type | function | ||||||
Dictionary | LCS | ||||||
Library | LiveCode Script | ||||||
Syntax |
| ||||||
Summary | Returns the object which received the message that started execution. | ||||||
Introduced | 1.0 | ||||||
OS | mac, windows, linux, ios, android | ||||||
Platforms | desktop, server, mobile | ||||||
Example |
| ||||||
Values |
| ||||||
Related | Property: script, name, text Message: mouseDown Keyword: me, target, button Object: card, button Function: dragSource, dragDestination, selectedObject Glossary: return, property, handle, handler, execute, pass, message, card, keyword, object reference, object Control Structure: function | ||||||
Description | Use the target function within a message handler to determine which object originally received the message. Suppose a card script contains a mouseDown handler. If the user clicks a button, a mouseDown message is sent to the button. If the button's script does not contain a mouseDown handler, the message is passed to the card, and handled by the card's mouseDown handler. The target function is similar to the me keyword. In the example described above, within the card's handler, the target function returns the button's name, because the button is the object that first received the mouseDown message. However, the me keyword is a reference to the card, because the card is the object whose script contains the mouseDown handler that is executing. | ||||||
Tags | objects |