Flash Web Design oder: the art of motion graphics

The lastbut vitally importantstep is to run the initialization routine from the main movie. This process uses the Call action. The Call action "calls" any labeled frame script in any movie clip, in this case, the Script movie clip. The playback head of that movie clip does not actually move to the frame. The script there is simply executed.

  1. In the main Timeline, create a layer called Actions. Double-click the first keyframe in the Actions layer to open the Frame Properties dialog.

  2. From the Actions panel, select the Add Actions button and choose Call from the drop-down list.

  3. In the Frame text area, enter the name of the object, followed by a colon and the name of the code to be called.

    For example, to run the initialize routine of my script object, I enter the following:

    /scripts:initialize

    This executes or calls the initialization script inside the Script movie clip, as shown in figure 08:21.

    Figure 08:21.

Now the main Timeline calls the initialization script and then loads the movies. The rest of the movie will work even when the Subway and Tunnel movies are still loading. If we kept the Subway and Tunnel movies in the main Timeline, we'd get stuck in the movie waiting for these large animations to load.

Категории