Name: nameChanged

Type: message

Syntax: nameChanged <pOldName>, <pNewName>

Summary:
Sent to an <object(glossary)> when its <name> is changed.

Associations: stack, card, field, button, graphic, scrollbar, player,
image

Introduced: 1.0

OS: mac, windows, linux, ios, android

Platforms: desktop, server, mobile

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

Parameters:
pOldName:
The object's original name.

pNewName:
The object's new name.

Description:
Handle the <nameChanged> <message> if you want to make updates when an
<object|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|stack's> name changes.

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

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

Tags: objects

