FREEINTERACTIVEPROOFING.COM

army drownproofing - www.freeinteractiveproofing.com

Menu


A different video file is associated with each section of the Timeline (Penguins.flv with frame 10, Mandrill.flv with frame 20, and so on).


Now you need to write the ActionScript that moves the playhead to the appropriate frame in the Timeline when the button is clicked. You can use the same set of code for each button, with minor changes. The first line of code adds an event listener, similar to the one you used in Lesson 7. The event listener listens for the button click, and then runs the function (clickListener1, clickListener2, and so on), which you define in the following lines. The function moves the playhead to the appropriate frame in the Timeline. When the playhead moves, the appropriate video file plays, according to the controls in the FLV playback component. 1. Select frame 1 in the Actions layer, and open the Actions panel. Note To open the Actions panel, choose Window > Actions. 2. Add an event listener for the first button by typing the following line in the Actions panel: this.video_button1.addEventListener(MouseEvent.CLICK,clickListener1); 3. Define the clickListener1 function by typing the following lines in the Actions panel: function clickListener1(event:MouseEvent):void { gotoAndPlay("penguins"); } 4. Copy and paste the lines you just added three times, and then modify each set for the appropriate video: first copy: video_button2, clickListener2, and "mandrill" second copy: video_button3, clickListener3, and "tiger" third copy: video_button4, clickListener4, and "lion". Note You can also copy the lines of the script from the Actions panel in the 09End.fla file. this.video_button2.addEventListener(MouseEvent.CLICK,clickListener2); function clickListener2(event:MouseEvent):void { gotoAndPlay("mandrill"); } this.video_button3.addEventListener(MouseEvent.CLICK,clickListener3); function clickListener3(event:MouseEvent) { gotoAndPlay("tiger"); } this.video_button4.addEventListener(MouseEvent.CLICK,clickListener4); function clickListener4(event:MouseEvent) { gotoAndPlay("lion"); } [View full size image] 5. Close the Actions panel.   Working with Video that Includes Alpha Channels For the thumbnail buttons, you used video files that fill the FLV playback component. Sometimes, though, you want to use a video file that doesn't include a background. For this project, the zoo director was filmed in front of a green screen, which was removed using Adobe After Effects. When you use the video in Flash, the zoo director appears to be in front of the Flash background. You'll import the video file, which is already in FLV format, into an FLV video component. However, you won't include a skin. The zoo director will appear directly on the Stage.