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

Lesson 7. Checking Input & Displaying Errors

Lesson 7. Checking Input & Displaying Errors

In the previous lesson, you built an interactive step-through simulation, in which users followed directions to create a System Data Source Name, or DSN, in a simulated environment. At the end of that lesson, you discovered a problem: Users could enter anything they wanted (or nothing at all) into the text fields of the ODBC Microsoft Access Setup screen, and the simulation would keep going.

Sometimes providing a little leeway is good, because users have a chance to play with the simulation, which in turn may help them internalize it. Other times, though, a little too much freedom can break the illusion that the simulation creates, which is what happened in the DSN simulation. The problem is that a few screens later, the simulation displays the correct text field entries, regardless of what the user actually entered.

In this lesson, you will add some scripts that add error-checking. You will also learn how to manipulate object properties, such as a movie clip instance's visibility.

This problem can be solved in two possible ways. First, you could verify that the user did indeed enter the proper text; or second, in the later screens, you could have the simulation display the text the user actually entered. Both options are possible in Flash. To do the first, which is what you will do in this lesson, you will set up a branching script that reacts one way if the user entered the correct information, and another way if the user did not. The second solution uses dynamic text, in which you use a variable to store the text that the user enters. In later screens, you display the text contained in the variable. Dynamic text is quite powerful, and you will work extensively with it in later lessons.

In this lesson, you will focus on flow control, which refers to scripts that handle branching depending on what the user does. Several Flash actions can be used for flow control, including for loops and if…else structures. In this lesson, you will use an if…else structure to continue on if the user entered the correct string, or to display an error dialog if the user did not. This way, the user cannot proceed unless she or he has entered the correct text in each text field.


In this lesson, you will:

  • Base a new symbol on an existing symbol

  • Build a functioning error message dialog

  • Use if…else to verify and respond to user input

  • Remove case sensitivity when validating a text string

  • Remove the automatic hand cursor over hotspots


This lesson takes approximately 1½ hours to complete.


Starting Files


Completed Files




Not a subscriber?

Start A Free Trial

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