|
SWF5-Selection object
5
12
656 bytes
1205 bytes
2002-01-12 00:00:00
2002-02-05 15:25:30
oldes (oliva.david@seznam.cz)

To show how to use the "selection" object and it's methods
|
|
background 152.174.149
fnt_arial: defineFont2 [name "Courier New" bold]
txt_test: EditText 'x 320x200 [
ReadOnly
Color 0.0.0
Font [fnt_arial 12]
Layout [align: 'left Leading: -2]
]
place txt_test
DoAction [
s: "selection object"
]
frm_loop: show frame
DoAction [
with selection [
x: s + {
Selection.getBeginIndex() = } + getBeginIndex() + {
Selection.getCaretIndex() = } + getCaretIndex() + {
Selection.getEndIndex() = } + getEndIndex() + {
Selection.getFocus() = } + getFocus() + {
s.charAt(1) = } + s.charAt(1) + {
s.charCodeAt(1) = } + s.charCodeAt(1) + {
to-char Key.getAscii() = } + to-char key.getAscii() + {
key.getCode() = } + key.getCode()
]
]
show 5 frames
DoAction [
either i = false [
s: s.toUpperCase()
i: true
][
s: s.toLowerCase()
i: false
]
with selection [
if getBeginIndex() == getEndIndex() [
setFocus("_level0.x")
setSelection(0 9)
]
]
goto frm_loop and play
]
showFrame
end
|