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

Chapter 10. Controlling Text > Rearranging Strings

Rearranging Strings

When 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 via methods such as concat(), fromCharCode(),slice(),split(), substr(), and substring(). Many of these methods are similar. In this section, we will discuss only substring(), to get a specific portion of a string, and concat(), to put several strings together. You can use a combination of these two methods to control the information that flows from input text fields into the rest of your Flash movie and back out into dynamic text fields.

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


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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