nameChanged

Typemessage
DictionaryLCS
LibraryLiveCode Script
Syntax
nameChanged <pOldName>, <pNewName>
Associationsstack, card, field, button, graphic, scrollbar, player, image
Summary

Sent to an object when its name is changed.

Introduced1.0
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Parameters
NameTypeDescription
pOldName

The object's original name.

pNewName

The object's new name.

Example
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
RelatedProperty: showName, groupNames, cardNames, name, number
Control Structure: pass
Message: IDChanged
Object: stack
Function: stacks
Glossary: trap, message, popup menu, menu, object
Description

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

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

Tagsobjects