Adding Behaviors to Timelines

In Chapter 14, we covered the behaviors that manipulate layers (namely Drag Layer and Set Text of Layer). You can add other behaviors to a timeline, such as the Set Text of Status Bar behavior, which displays a message in the browser status bar, or the Show-Hide Layers behavior, which (surprise!) shows and hides layers.

Behaviors are added in the Timelines panel’s Behaviors channel , indicated by the letter B in Figure 17-5.

A behavior in the Timelines panel

Figure 17-5. A behavior in the Timelines panel

To add a behavior to a timeline, click a frame in the Behaviors channel of the Timelines panel and choose a behavior from the Behaviors panel’s Add Behavior (+) pop-up menu. (You can also use Modify Timeline Add Behavior to Timeline, which opens the Behaviors panel for you). Timeline behaviors can be added in any frame of the timeline (in either keyframes or tween frames).

Tip

You can associate multiple behaviors with the same frame of a timeline. Behaviors are applied in the Timelines panel’s Behaviors channel, not to the animation channels. They can be used to trigger actions at specific times without user interaction, even if you’re not performing animations.

Attaching a behavior to a timeline adds the same JavaScript code that is added when attaching the behavior to other objects. The primary difference is that timeline events are always triggered when a particular frame is reached ...

Get Dreamweaver in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.