Lingo Dictionary > A-C > currentSpriteNum

 

currentSpriteNum

Syntax

the currentSpriteNum

Description

Movie property; indicates the channel number of the sprite whose script is currently running. It is valid in behaviors and cast member scripts. When used in frame scripts or movie scripts, the currentSpriteNum property's value is 0.

The currentSpriteNum property is similar to spriteNum of me, but it doesn't require the me reference.

This property can be tested but not set.

Note: This property was more useful during transitions from older movies to Director 6, when behaviors were introduced. It allowed some behavior-like functionality without having to completely rewrite Lingo code. It is not necessary when authoring with behaviors and is therefore less useful than in the past.

Example

The following handler in a cast member or movie script switches the cast member assigned to the sprite involved in the mouseDown event:

on mouseDown
	sprite(the currentSpriteNum).member = member "DownPict"
end

See also

me, spriteNum