Flash : Creating a dialog box
David Einhorn
Opening and Closing the Window
To simulate the opening and closing of our window, we will add a new image to the window symbol. The first image, which already
exists, will represent the window when it is open. The second, when it is closed. So we just need to display the first or
the second image, depending on whether the opening or the closing button is clicked.
- Display the window object.

- Select Insert > Keyframe.

A new image is created.
- Delete the Close button of this new image and replace it with the Open button.

- Delete the grey rectangle of the window object. Only the window title bar should now be visible.


Figure 5: Two images for the two window states
The operation is not at all complicated - neither from the graphical nor from the technical point of view. We just need to
switch from one state to the other by clicking on the Open and Close buttons.
- Revert to the first frame using the timeline.

- Select the frame and Modify > Frame from the menu bar.

- Click on the + button of the Actions tab and select the Stop command.

This precaution prevents one animation switching to the other before the visitor has clicked on it. Revert to the image.
- Select the Close button and Modify > Instance from the menu bar.

- Click on the + button of the Actions tab and select Go To in the command list.

- Enter 2 as the frame number in the right-hand side of the window.

To enable you to reopen the window, repeat steps 5 and 6 with the Open button of frame 2, specifying 1 as the frame number
for the Go To action.
New dimensions Since the size of the graphic element on the second frame has now changed, you must also redefine the constraining rectangle's
lower dimension coordinate.
That's it!
Now your window is fully operational. You just need to fill the first symbol's image with the contents of the window and then you can duplicate the windows as
often as you want.