Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
Now we'll take our bitmap object and have it play along with the video on the stage. If you're following along, I'm working in 07_Copying_Video.fla in the Chapter 08 folder in the Exercise Files folder. Let's select the first keyframe in the actions layer. Open the Actions panel by pressing Option+F9 on the Mac or F9 on the PC. At the very bottom of your code let's add an event listener to the stage. So type staged.addEventListener and the event will be Event.ENTER_FRAME, all caps. We'll run a function called drawReflection.
And below the variables that we created, let's define the draw reflection function. Create a function called drawReflection. It will receive an event with a type of Event. And this function and we'll simply call videoData, capital D, dot draw and we'll pass in video_mc. Now this is doing the same thing that we did in my code on line 9, where we connect the content of our video on the stage to our bitmap data object. And this is redrawing our bitmap data object and resetting the information inside that object.
This is what will make our bitmap object animate on the stage along with the video. So let's test the movie and see this in action. Command+Return on the Mac, Ctrl+Enter on the PC. And notice that our bitmap object plays along with our video on the stage So now our bitmap object is connected to our video. The next step is to reflect the video.
Get unlimited access to all courses for just $25/month.Become a member
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.
Your file was successfully uploaded.