Recipe 12.5. Building a Presentation Using the Flash 8 Cookbook
You want to build a presentation application using the
Flash 8 Cookbook
components instead of using a template or a Slide presentation.
Use the Presentation component.
The Presentation component that is included with the
Flash 8 Cookbook
designed to allow you to create presentation applications that unite some of the best qualities of the template and the Slide presentation options mentioned in previous recipes. Using the Presentation component, you can quickly and simply put together a basic presentation, but without having to know any ActionScript or advanced Flash techniques. What's more, the Presentation component allows you to add transition effects without having to rely on a Slide presentationa Flash Professionalonly feature.
The Presentation component is designed to work in one of two ways: either with sequential keyframes on a timeline or with specially named movie clip symbols in the library. The former is, arguably, the simpler of the two techniques, while the latter provides a slightly more robust feature set.
The first way that you can use the Presentation component allows you to set up a presentation in a manner that is almost identical to the template technique discussed in Recipe 12.1. You can set a target for the component, and the component will automatically pause the playback of the target timeline and allow the
to navigate through the
using the right and left arrow keys. By default, the target timeline for a Presentation component is the timeline in which the instance has been placed. For example, if you place an instance of the Presentation component on the main timeline, the main timeline will be
and navigable with the arrow keys. You can also choose to specify another movie clip instance for the component to target. You can do so by setting the component's container parameter using the Component Inspector panel. In order to specify another movie clip instance to target, you must have a working understanding of target paths in Flash (see Chapter 10 for more information). The container parameter should be relative to the timeline in which the component instance has been placed. For example, if the component is placed in the main timeline and you want to have it target a movie clip instance in the main timeline with the
, you should use the value of
for the container parameter. If you specify another movie clip instance as the target, only that movie clip instance will be controlled with the arrow keys. For example, if you set the container parameter to
, the timeline of
will be paused and navigable, but the main timeline will no longer be controlled by the component.
You can use many of the same techniques that you used with the presentation templates when working with the Presentation component. For example, if you want to have a continuous background throughout each screen of your presentation, add a layer to the bottom of the content timeline that contains that artwork on a single keyframe that extends the length of the timeline. That way, even though the contents layer will change with each keyframe, the background artwork will
constant. You may want to refer to Figure 12-1 for a visual representation of what that would look like (though you will not need an actions layer in such an example). You should also make sure that the Presentation component instance itself remains constant throughout the timeline, if
. Therefore, you may want to place the Presentation component instance on its own layer similar to how you create the background layer.
The second manner in which you can use the Presentation component is by working with specially named movie clip symbols. The sequential frame technique is fine for; most presentations, but it does not allow you to add transitions between the screens, the second technique does. In order to use the Presentation component in this manner, follow these steps:
Create an instance of the Presentation component.
Create a movie clip symbol for each screen of the presentation. The movie clip symbols will be programmatically added to the application by the component and, as such, they are consistently aligned so that the 0,0 coordinate point within the movie clip symbol's coordinate space lines up with the 0,0 coordinate point of the container movie clip's coordinate space. In practical terms, that means that if the Presentation component instance itself is being used as the container (the default behavior) then each screen will be aligned so that its 0,0 point will be aligned to the upper-left corner of the component instance. If the main timeline is used as the container, the screens will be aligned to the
corner of the stage.
Set each movie clip symbol to export and give them specific linkage identifiers. Setting a symbol to export is necessary to allow Flash to programmatically add the content, and because the component looks for symbols with particular identifiers, it is important that the linkage identifiers match the correct pattern. The linkage identifiers should be Slide1, Slide2, Slide3, and so on. You can set the symbols to export and give them linkage identifiers by selecting the symbol in the library, right-clicking or Command-clicking on the symbol name, and choosing Linkage from the menu that appears. In the Linkage Properties dialog box select the Export for ActionScript option. Doing so will also select the Export in First Frame option automatically. Leave both checkboxes selected. Then specify the linkage identifier and click OK.
steps sets up a basic presentation using the Presentation component and specially named movie clip symbols.
You can also add a constant background to a presentation that uses the named movie clip technique. All you need to do is create a movie clip symbol that contains the background artwork, set it to export, and give it a linkage identifier of PresentationBackground.