583
Example
The following handler displays the currently selected text being placed in a local variable object.
Then that object is used to reference various characteristics of the text, which are detailed in the
Message window.
property spriteNum
on mouseUp me
mySelectionObject = sprite(spriteNum).member.selectedText
put mySelectionObject.text
put mySelectionObject.font
put mySelectionObject.fontSize
put mySelectionObject.fontStyle
end
selection() (function)
Syntax
the selection
Description
Function; returns a string containing the highlighted portion of the current editable field. This
function is useful for testing what a user has selected in a field.
The
selection
function only indicates which string of characters is selected; you cannot use
selection
to select a string of characters.
Example
This statement checks whether any characters are selected and, if none are, displays the alert
“Please select a word.”:
if the selection = EMPTY then alert "Please select a word."
See also
selStart
,
selEnd
selection (cast property)
Syntax
castLib (
whichCast
)
.
selection
the selection of castLib
whichCast
set the selection of castLib whichCast =[ [
startMember1
,
endMember1
], \
{[
startMember2
,
endMember2
], [
startMember3
,
endMember3
]...]}
castLib(
whichCast
). selection =[ [
startMember1
,
endMember1
], \
{[
startMember2
,
endMember2
], [
startMember3
,
endMember3
]...]}
Description
Cast property; determines which cast members are selected in the specified Cast window. The
range appears as a list of the starting and ending cast member numbers for the selected range. You
can include more than one selection by specifying additional ranges of cast members. (To specify
more than one selection, Control-drag (Windows) or Command-drag (Macintosh).
This property can be tested and set.
Содержание DIRECTOR MX-LINGO DICTIONARY
Страница 1: ...Lingo Dictionary Macromedia Director MX...
Страница 756: ...Index 756...