•
specifies a range of possible values that the user can assign to the property. Specify the
#range
possible values as a list.
To specify a range between a minimum and maximum number, use the form [
#max:maximum
maximum or minimum number, the Parameters dialog box provides a slider that sets the value.
To specify no range, omit the
, a text entry field appears for the user to enter a value in the Parameters dialog box.
#range
To specify a set of possible choices, use a linear list. For example, the list
#mouseDown, #keyUp, #keyDown]
When you specify values in a linear list, the choices appear in a pop-up menu in the
Parameters dialog box. (For this example list, you need to specify
the list to display correctly.)
As another example, this statement defines the property
description.addProp(#whichSound,
"Which cast member"]
The value
#sound
includes every sound cast member available in the movie.
If the behavior includes a method that plays a sound, this property can be used to specify a sound
cast member to play. For example, if the user selects Growl from the pop-up menu in the
Parameters dialog box, the statement
member Growl.
Creating an on getPropertyDescriptionList handler
To build a list of properties for a behavior, add each property to the list that the
on getPropertyDescriptionList
the list.
For example, this handler creates a property list named Description that contains the definitions
for
and
movement
--Lingo syntax
on getPropertyDescriptionList
description = [:]
description[#movement] = \
description[#noise] = \
return description
end
284
Chapter 12: Behaviors
]
The example sets the range from 1 to 10. When the range is between a
.
#range
assigned to
provides a pop-up menu in the Parameters dialog box that
#format
puppetSound whichSound
handler returns. Then use the
:
whichSound
[#default: 5, \
#format:#integer, \
#comment: "Set motion to the right:", \
#range: [#min:1, #max:10] \
]
[#default:"", \
#format: #sound, \
#comment:"Sound cast member name" \
]
parameter. If the property's definition does not include
makes these four events possible choices for a parameter.
whichSound
[#default: "", #format:#sound, #comment: \
#min:minimum,
[#mouseUp,
#format: #symbol
:
would play the sound cast
method to return
return
for
Need help?
Do you have a question about the DIRECTOR MX 2004-USING DIRECTOR and is the answer not in the manual?
Questions and answers