Adobe Flash

Add a frame script to the Title movie clip

The final step is to add a script to the last frame of the Title movie clip. This script is used to display the text "Home" in the Title movie clip when its animation has completed.

From the Library panel, select the Title movie clip and its timeline is displayed.

Selecting the Title movie clip timeline to add a script to the last frame

With the Actions layer selected, select the last frame (14) on the Timeline.

In the Actions panel, click Script Assist to display Script Assist mode.

Using either the Actions toolbox or the Add button on the Actions panel toolbar, select Global Functions > Timeline Control and insert the stop() function.

Next, using either the Actions toolbox or the Add button, select ActionScript 2.0 Classes > Movie > MovieClip > Methods > gotoAndStop.

Modifying function parameters to complete the script
In the Script Assist panel, select the gotoAndStop action on line 2.

Click in the Object text box.

Click the Insert Target Path button.

In the Insert Target Path dialog box, click the _root object and click OK.

In the Frame text box, enter home.

Deselect the Expression checkbox.

Now, when the Title movie clip reaches the last frame and the animation is complete, "Home" is displayed. This is the initial state of the application, after it loads and before the user clicks any of the buttons.

Save your work.

All of the scripts needed to run the sample application are now complete and the application is ready to be tested.