976
Chapter 14: Properties
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
setScriptList()
. It may not be set during a score
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()
,
value()
scriptNum
Usage
sprite(
whichSprite
). scriptNum
scriptNum of sprite
whichSprite
Description
Sprite property; indicates the number of the script attached to the sprite specified by
whichSprite
. If the sprite has multiple scripts attached,
scriptNum
sprite property returns the
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.
Содержание DIRECTOR MX 2004-DIRECTOR SCRIPTING
Страница 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Страница 48: ...48 Chapter 2 Director Scripting Essentials...
Страница 100: ...100 Chapter 4 Debugging Scripts in Director...
Страница 118: ...118 Chapter 5 Director Core Objects...
Страница 594: ...594 Chapter 12 Methods...
Страница 684: ...684 Chapter 14 Properties See also DVD...
Страница 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Страница 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Страница 889: ...netPresent 889 _player alert Sorry the Network Support Xtras could not be found See also Player...
Страница 1102: ...1102 Chapter 14 Properties...