Viewers: in countries Watching now:
In Flash Professional CS5: Code Snippets and Templates in Depth, David Gassner shows designers how to use Flash Professional CS5's Code Snippets panel and file templates to get started with ActionScript 3 and implement best practices. This course describes how to insert snippets into existing Flash presentations, includes a detailed explanation of the code behind the snippets, and shows how to use the many templates included with Flash Pro CS5 to quickly create customized presentations. Exercise files are included with the course.
In Flash Professional CS4, the Flash Professional authoring environment received a new tool called the Bone tool, which is used in a style of animation known as Inverse Kinematics. In Flash Pro CS5, a new file template is included called the IK Stick Man Sample. IK stands for Inverse Kinematics and it shows an example of using the Bone tool to create a figure that walks across the screen. I'll create a new file based on this template and then test it and show you its effect.
It executes a continuous looping animation. The legs, the arms, the torso, and the head are all animated simultaneously and this is all done with the Bone tool and Inverse Kinematics. Let's take a look at the architecture of the presentation. Everything is being done here in the Armature_1 layer of the Timeline. There are natural shapes representing the head, body, legs, and arms and then multiple bone objects that are causing the animation to happen.
In the Armature_1 layer, there are poses represented as keyframes. Each of the poses shows a different positioning for each of the objects. A pose is somewhat like a motion tween. So when you add a new pose, Flash calculates the difference between the previous pose and the new one and causes all of the animations simply to happen. The result is the walking effect that you see here. Now let's add to this animation. I'll go to the Timeline to frame number 50.
I'll right-click on that frame in the Armature_1 layer and select Insert Pose. That creates a new keyframe. Then I'll click on the hinge that represents the front ankle and drag it forward until it looks like the figure kicked something. Then I'll click on the toe and straighten it out a little bit so it looks like the toe is pointing. Then I'll freeze the action at that point by adding a stop command into that frame. With this playhead in frame number 50, I'll go to the Code Snippets panel, to the Timeline Navigation category and add the code snippet, Stop at this Frame.
I'll close the Actions panel and Code Snippets panel and test the movie. In the final frames of the movie the figure now looks like it's kicking something. To complete this movie, I'll add something for it to kick. In the Exercise Files, in the Ch08_ SampleFiles folder, I have included a Flash file called Assets.fla. It has a picture of a soccer ball. I'll test the movie and show that the soccer ball has its own internal animation causing it to rotate counterclockwise continuously.
This is being done in the mcSoccerBall symbol where there is a Timeline and a motion tween that's causing the rotation to happen. I'll go back to scene number 1 and click on the instance of the symbol on the stage and copy it to the Clipboard. Then I'll return to my presentation with the Inverse Kinematics figure and I'm going to create a new layer. I'll right-click on the Armature layer and insert a new layer. I'll name the new layer Ball. Then I'm going to place a keyframe in frame number 20.
I'll right-click on that frame in the Ball layer and choose Insert Keyframe. Then I'll paste the object into the movie in that position. I'm going to place the object off- screen to the right, right at about the foot level of the figure. Then I'm going to create a two-part animation. I'll right-click in the Ball layer somewhere after the keyframe and choose Create Motion Tween. Then with the playhead in frame number 40, I'll move the ball so that it's in a position to be kicked.
I'll hold down the Shift key and move the ball to the side by holding the Shift key and make sure it retains its vertical position as I drag it. Then in the Timeline, I'll move the playhead to frame number 50 and I'll move the ball to the upper-right corner of the presentation just off-stage. That creates the second part of the motion tween. Then to give the ball a little bit of extra movement, I'll give it a little bit of a curve so that it appears to be a ascending at a faster rate as it goes. Now I'll play the movie.
The figure walks along, the ball rolls on to the screen, the figure kicks the ball and the ball ascends off the screen to the right. So I have shown here how to use the IK Stick Man Sample template and then I've extended and added functionality to it to create an interesting animation that combines Inverse Kinematics with motion tweens and movie clip symbols. Once again, to base your own presentation on this particular new file template, you would need to replace the natural shapes with your own photographs or other images.
I have used one external image, the soccer ball, and a prepared movie clip symbol that I've used from another Flash presentation. But once again, the goal of the sample files in the New File templates in Flash Pro CS5 is more to teach you what's possible instead of creating a basis for your own presentations. Once you've seen how you can connect natural shapes using the Bone tool and the Inverse Kinematics and then animate those objects with poses, you'll understand a little bit more about the tools that you can use to create whatever presentations you can imagine.
There are currently no FAQs about Flash Professional CS5: Code Snippets and Templates in Depth.
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.