me

Typekeyword
DictionaryLCS
LibraryLiveCode Script
Syntax
me
Summary

Equivalent to the object that contains the currently running handler.

Introduced1.0
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Example
set the borderWidth of me to it
put the short ID of me into tSavedID
put me into myVariable -- puts contents, if me is a container
put me into myVariable -- puts name, if me is not a container
RelatedProperty: script, behavior, name
Glossary: object, return, handler, button, execute, message, keyword, object reference
Message: mouseDown
Keyword: card
Object: card, button
Control Structure: function
Function: menuButton, target
Command: dispatch
Description

Use the me keyword within a handler to determine which object's script is executing.

The me keyword is a reference to the object whose script contains the current handler. If me is executed in a behavior script, then me refers to the object that is executing the behavior script.

If the currently executing handler is in the script of the object that received the original message, then me is the same as the object whose name is returned by the target function. For example, suppose a button script contains a mouseDown handler. The value of the target function within that mouseDown handler is the same as the name of me: the name of the button.

However, if the mouseDown handler is in the card's script instead of the button's, me is not the same as the object specified by the target. In this case, me is the card, but the target function returns the button's name, because the button is the object that first received the mouseDown message.

The me keyword can be used anywhere an object reference is used.

Tagsobjects