1074
ActionScript classes
// convert the selected text to upper case.
temp= target.text.substring(beginIndex,
endIndex).toUpperCase();
break;
case 'Lowercase...' :
temp= target.text.substring(beginIndex,
endIndex).toLowerCase();
break;
}
// append the text after the selected text to the temporary string.
temp= target.text.slice(endIndex);
// set the text in the target text field to the contents of the temporary
string.
target.text = tempString;
}
}
See the Strings.fla file for the entire script. Typical paths to the ActionScript samples folder
are:
■
Windows:
boot drive
\Program Files\Macromedia\Flash 8\Samples and
Tutorials\Samples\ActionScript
■
Macintosh:
Macintosh HD
/Applications/Macromedia Flash 8/Samples and Tutorials/
Samples/ActionScript
See also
getBeginIndex (Selection.getBeginIndex method)
getFocus (Selection.getFocus method)
public static getFocus() : String
Returns a string specifying the target path of the object that has focus.
■
If a TextField object has focus, and the object has an instance name, this method returns
the target path of the TextField object. Otherwise, it returns the TextField's variable name.
■
If a Button object or button movie clip has focus, this method returns the target path of
the Button object or button movie clip.
■
If neither a TextField object, Button object, Component instance, nor button movie clip
has focus, this method returns
null
.
Availability:
ActionScript 1.0; Flash Player 5 - Instance names for buttons and text fields
work in Flash Player 6 and later.
Returns
String
- A string or
null
.
Содержание FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Страница 1: ...ActionScript 2 0 Language Reference ...
Страница 1352: ...1352 ActionScript classes ...