The String Class

Get Adobe Flash player

The String class is built-in to Flash. Just as there are many operations we can do with numbers, such as adding and subtracting, there are many operations we can do with Strings.

  • Start a new ActionScript 3 file.
  • In the ActionScript window declare a String variable with an initial value:


When you type s. the list of methods will appear.
Type trace(s.charAt(3));

You will see the letter D in the output window. Like most things in computers, numbering starts with 0.  Thus, s.charAt(0) is the letter A.

Next Page: String Functions

This lesson: Strings in ActionScript, The String Class, String Functions, Anagrams, Cryptograms
Like us on Facebook:

OER: Open Educational Resource
Creative Commons License Author: Janet E. Joy; Publisher:
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License
Creative Commons Attribution-NonCommercial 4.0 International License