User Guide

name (Sprite Channel) 885
Example
This statement sets the variable itemName to the name of the eighth item in the Edit menu:
set itemName = the name of menuItem(8) of menu("Edit")
This statement causes a specific filename to follow the word Open in the File menu:
the name of menuItem("Open") of menu("fileMenu") = "Open" && fileName
See also
name (menu property), number (menu items)
name (Sprite)
Usage
-- Lingo syntax
spriteObjRef.name
// JavaScript syntax
spriteObjRef.name;
Description
Sprite property; identifies the name of a sprite. Read/write during a Score recording session only.
Unlike sprite display properties such as
backColor and blend, a sprite name cannot be a scripted
sprite. This means that the
name can only be set during a Score recording session—between calls
to the Movie object’s
beginRecording() and endRecording() methods. You can only set the
name if beginRecording() is called on or before a frame in the Score that contains the sprite.
Note: Starting a Score recording session using beginRecording() resets the properties of all scripted
sprites and sprite channels.
If you use script to create a new sprite during a Score recording session and you use
updateFrame() to apply the sprite data to the session, you cannot set the sprites name until you
go back to the frame in which the sprite was created. Use a method such as
go() to go back to a
specific frame.
Example
This statement sets the name of sprite 5 to Background Sound:
-- Lingo syntax
sprite(5).name = "Background Sound"
// JavaScript syntax
sprite(5).name = "Background Sound";
See also
beginRecording(), endRecording(), go(), Sprite, updateFrame()
name (Sprite Channel)
Usage
-- Lingo syntax
spriteChannelObjRef.name