Controlling Timelines with Behaviors


Adding a behavior to the timeline is similar to adding a behavior to any other object, except that you attach the behavior to a single frame in the timeline and not to the entire animation bar. The behavior is added to the Behaviors channel, and a dash in the Behaviors channel indicates which frame the behavior was applied to.

Events don't have to start at the beginning of the timeline. You can use the timeline to delay action on the page until a certain time after the page loads by moving the animation bar to the right to create the desired number of empty frames.

To add a behavior, click the desired frame in the Behaviors channel above the playhead. Open the Behaviors panel and add the desired behavior.

  • Autoplay. Uses JavaScript to make the timeline play when the page loads. A behavior is attached to the page's <body> tag; the behavior automatically executes the Play Timeline action when the page loads in a browserusing the onLoad event, which will cause the animation to begin once the document has finished loading in the browser. At times you might want the user to control the playback of the timeline. You can add a Start Timeline button to play the animation when the user rolls over a button or clicks an image. Select the first frame in the Timelines panel. Select the image or button you want to use. In the Behaviors panel, click the plus sign (+) button to add a behavior and choose the Timeline > Play Timeline behavior.

  • Loop. If you select Loop on the Timelines panel, a behavior is added in the last frame that returns the playback head to Frame 1 and plays the timeline again. The behavior is added to the Behaviors channel and appears as a dash above the last frame. You can edit the parameters for this behavior to define the number of loops by selecting the dash in the Behaviors channel and double-clicking the corresponding action in the Behaviors panel. A dialog box will allow you to set how many times the animation will loop and in what frame it will begin to loop.

  • Show / Hide. You can make multiple layers appear and disappear at once by selecting other layers in the Named Layers list and clicking the Show or Hide buttons. Default will restore the layer's default visibility. Layers do not have to be in the Timelines panel for you to show or hide them with this behavior.




Macromedia Dreamweaver 8(c) Training from the Source
Macromedia Dreamweaver 8: Training from the Source
ISBN: 0321336267
EAN: 2147483647
Year: 2006
Pages: 326

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net