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

Adding an Alert

The Alert component lets you create a popup a window that presents the user with a message and response buttons. An Alert window can have any combination of Yes, No, OK, and Cancel buttons. Alert components are used when it’s important to get a piece of information to the user. For example, a data validation routine indicates that the user is not entering in their zip code; you can create an Alert component that informs them of their error, and makes them go back and type in their zip code.

Add an Alert Component

Open the Components panel.

Click the UI Components Expand triangle.

Drag the Alert component onto the Stage, and then select the component.

Press the Backspace key to delete the Alert window from the Stage. This removes the Alert component from the Stage, but keeps the component as a complied clip in the Library.

Select the first keyframe in the Flash document.

See Also

See Chapter 15, “Using Basic ActionScripts” on page 333 for more information on writing ActionScripts.

Open the Actions panel, and then enter the script as shown in the illustration.

This code creates an Alert window with OK and Cancel buttons. When either button is pressed, the myClickHandler function is called. But when the OK button is pressed, the startKnowledgeApplication() method is called. In this test, a trace box opens and displays the message Launch Knowledge Application.

Click the Control menu, and then click Test Movie.

IMPORTANT Since Alert components are only visible when called, it is standard procedure to first drag the Alert component to the Stage, and then delete it. It is the Alert component in the Library that is called, not the one on the Stage.



Not a subscriber?

Start A Free Trial

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