User Guide

886 Chapter 14: Properties
// JavaScript syntax
spriteChannelObjRef.name;
Description
Sprite Channel property; identifies the name of a sprite channel. Read/write during a Score
recording session only.
Set the
name of a sprite channel during a Score recording session—between calls to the Movie
object’s
beginRecording() and endRecording() methods.
Note: Starting a Score recording session using beginRecording() resets the properties of all scripted
sprites and sprite channels.
Unlike a Sprite objects name property, which can only be set on or after a frame in which a
sprite appears in the Score, a Sprite Channel object’s
name property can be set on an empty
channel. This means that you do not need to call
updateFrame() before setting the name of
the sprite channel.
A change to a sprite channel’s name using script is not reflected in the Score window.
Example
This statement sets the name of sprite channel 6 to Kite String during a Score recording session:
-- Lingo syntax
on mouseDown
_movie.beginRecording()
channel(6).name = "Kite string"
_movie.endRecording()
end
// JavaScript syntax
function mouseDown() {
_movie.beginRecording();
channel(6).name = "Kite string";
_movie.endRecording();
}
See also
beginRecording(), endRecording(), Sprite Channel
name (timeout)
Usage
timeoutObject.name
Description
This timeout property is the name of the timeout object as defined when the object is created.
The
new() command is used to create timeout objects.
Example
This timeout handler opens an alert with the name of the timeout that sent the event:
on handleTimeout timeoutObject
alert "Timeout:" && timeoutObject.name
end