![]() ![]() |
|
While many books have been written about intricacies of programming Flash, if you have a technical mindset, you can learn enough to control CS Effects instances by following the examples in the distribution and these instructions.
Flash is a powerful graphics and animation engine that also has a powerful scripting (programming) capability. For many things, you will want to use the visual, drag-and-drop interface to create your movies. For more fine control, you will need to learn how to tell Flash to modify characteristics on the fly, and this will involve programming. The term "programming" shouldn't scare you; we are not writing equation solvers for systems of differential equations. Rather, we are just learning some simple commands you use to communicate with the elements you have placed on your Stage.
The following pages are meant to give you enough information to start modifying CS Effects instances your movies, not a tutorial on programming in general. Once you master the basics, you can find other sources to learn more about Flash programming and begin to tap its vast potential.
The first step is to figure out where you are going to be placing commands. For the most part, your commands will be placed on the Timeline.
The way to think about Flash movies is like regular movies: you create a series of images for Flash to show over time. A movie is made up of "frames", and runs at a set "frame rate." By default, Flash sets the frame rate at 15 fps (frames per second), which means that it executes 15 frames each second. The picture below shows a frame rate of 24 fps.

A "frame" can be either a keyframe, which is a new set of images you make, or a regular frame, which just carries over any images you have already placed in previous frames. When you want an image to appear at a particular moment in your movie, you create a keyframe at that moment in the Timeline, and position and size the images appropriately. To make images stay on the screen for more than an instant, you create a keyframe and the several regular frames following it. When you want to change the image to the next, you create a new keyframe following those regular frames.
Flash shows you keyframes by a circle graphic. That graphic is empty (white) if there are no images in that keyframe; it is filled in black if there is one or more images or elements in that keyframe:
An empty keyframe |
A keyframe with something in it |
You will see when you create a new Flash document that Flash automatically creates a keyframe at time position 1. If you want to add regular frames following position 1, choose the Insert > Timeline > Frame menu option. Flash will add a regular frame following the first keyframe, and a rectangular symbol will appear in the 2nd frame:
![]()
This rectangular symbol shows you the end of where the contents of the keyframe will be shown. When you draw something on the Stage or bring in a photo, Flash will put it in the current keyframe. The current keyframe (the one whose contents are being edited or added to) is the one underneath the red vertical line (frame 1, in the picture above).
If you want to create a new keyframe, use the Insert > Timeline > Keyframe menu option. Then Flash will create a new keyframe:

Tip: If you have multiple layers, inserting frames adds frames to the current layer. If you want to insert frames for all layers, select the red box above the numbers in the timeline, then insert your frames.
If you want to create some regular frames between your keyframes, click on the starting keyframe (on the Timeline). The little keyframe will be highlighted. Then choose Insert > Timeline > Frame (or in Windows, the keyboard shortcut F5). The keyboard shortcut in Windows for creating keyframes is F6.
You can only put images into keyframes, not regular frames. You will see when you insert a keyframe, it will copy the contents of the previous keyframe into the new keyframe. If you don't want to use those contents, instead of inserting a keyframe, choose Insert > Timeline > Blank keyframe.
To summarize, you place images and other Flash elements into a keyframe if you want the images to appear at a certain time. You create a series of keyframes to change the images over time.
Layers are used to separate content that would appear in the same frame. Layers let you control the viewing order of things appearing at the same moment. If you have two overlapping images, one on one layer and the other on another layer, the one on the top layer will be seen in its entirety; the one on the lower layer will be only visible in areas not occupied by the image on the upper layer.
You don't just put images into layers; you also put commands. While you can make your Flash movies with only one Layer, we recommend you create a separate layer to hold the commands. Use the Insert Layer button to create a new layer on the Timeline:

We recommend that you change the name of each layer to something meaningful, rather than the default Layer 1, Layer 2, etc. You can click on the dots next to the layer name to make it visible or not visible (the eye), lock it (to avoid moving or editing the contents), and show the elements as outlines (the box):

The Timeline gives the content for the movie. While a movie is running, Flash keeps track of the current time position in something called the playhead. The playhead advances according to the frame rate you set for your movie. You cannot change the frame rate in your movie once the movie starts playing. When the playhead is on a certain frame, Flash shows the contents of all layers that have frames defined in that moment.
We're now ready to put some commands in.
![]() ![]() |
|