nameChanged

Sent to an object when its name is changed.

# Metadata

Platforms: desktop, server, mobile OS: mac, windows, linux, ios, android Introduced: 1.0 Security:

# Syntax

nameChanged pOldName, pNewName

# Params

- pOldName : The object's original name. - pNewName : The object's new name.

# Examples

on nameChanged myOldName,myNewName -- replace name in a menu button put lineOffset(myOldName,button "Window List") into namePosition put myNewName into line namePosition of button "Window List" end nameChanged

# Description

Handle the nameChanged message if you want to make updates when an object name is changed. For example, if you have a popup menu with the names of stacks, the menu should be updated when a stack name changes.

The actual change is not triggered by the nameChanged message, so trap the message and not allowing it to pass does not prevent the name from being changed.

# Tags

# See

- **property:** showName, groupNames, cardNames, name, number - **control structure:** pass - **message:** IDChanged - **object:** stack - **function:** stacks - **glossary:** trap, message, popup menu, menu, object