-- Lingo syntax _player.currentSpriteNum // JavaScript syntax _player.currentSpriteNum;
Player property; indicates the channel number of the sprite whose script is currently running. Read-only.
This property 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 the Sprite object's spriteNum property.
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 script. It is not necessary when authoring with behaviors and is therefore less useful than in the past.
The following handler in a cast member or movie script switches the cast member assigned to the sprite involved in the mouseDown event:
-- Lingo syntax
on mouseDown
sprite(_player.currentSpriteNum).member = member("DownPict")
end
// JavaScript syntax
function mouseDown() {
sprite(_player.currentSpriteNum).member = member("DownPict");
}