• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 10. Controlling Text > Rearranging Strings with the String Object

Rearranging Strings with the String Object

Once you have information about the position of certain characters and the length of a string, you can select a portion of the string and put it in a new variable. Flash provides tools to get specific selections from a string and put them together with other strings using methods such as concat, fromCharCode, slice, split, substr, or substring. Many of these methods are similar. Here we will discuss only substring to get a specific portion of a string, and concat, to put several separate strings together. You can use a combination of these two methods to control the information that flows from input text boxes into the rest of your Flash movie and back out into dynamic text boxes.

The following task copies the current selection that the viewer has made and pastes it into a dynamic text box.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint