Example
This handler displays the list of script references attached to a sprite:
on showScriptRefs spriteNum
put sprite(spriteNum).scriptInstanceList
end
These statements attach the script Big Noise to sprite 5:
x = script("Big Noise").new()
sprite(5).scriptInstanceList.add(x)
See also
scriptNum,
sendSprite()
scriptList
Usage
sprite(whichSprite).scriptList
the scriptList of sprite whichSprite
Description
Sprite property; returns the list of behaviors attached to the given sprite and their properties.
This property may only be set by using
recording session.
Example
This statement displays the list of scripts attached to sprite 1 in the Message window:
put sprite(1).scriptList
-- [[(member 2 of castLib 1), "[#myRotateAngle: 10.0000, #myClockwise: 1,
#myInitialAngle: 0.0000]"], [(member 3 of castLib 1), "[#myAnglePerFrame:
10.0000, #myTurnFrames: 10, #myHShiftPerFrame: 10, #myShiftFrames: 10,
#myTotalFrames: 60, #mySurfaceHeight: 0]"]]
See also
setScriptList(),
scriptNum
Usage
sprite(whichSprite). scriptNum
scriptNum of sprite whichSprite
Description
Sprite property; indicates the number of the script attached to the sprite specified by
. If the sprite has multiple scripts attached,
whichSprite
number of the first script. (To see a complete list of the scripts attached to a sprite, see the
behaviors listed for that sprite in the Behavior Inspector.)
This property can be tested and set during Score recording.
976
Chapter 14: Properties
setScriptList()
value()
. It may not be set during a score
sprite property returns the
scriptNum
Need help?
Do you have a question about the DIRECTOR MX 2004-DIRECTOR SCRIPTING and is the answer not in the manual?
Questions and answers