Creating Special Effects
Because Flash's drawing tools are vector-based, you normally wouldn't think of incorporating a special effect, such as a motion blur, which is associated with bitmap applications such as Adobe Photoshop or Macromedia Fireworks. But integrating special effects is possible simply by importing a bitmap that has been altered by a special-effect filter. This technique can give your Flash movie more depth and richness by going beyond the simple flat shapes and gradients of vector drawings.
The following examples demonstrate a motion blur and a blur-to-focus effect. A motion blur is a camera artifact produced when something moves too fast for the film to capture; you see a blurry image of where the moving object used to be. Often, these images overlap, creating a streak that trails the fast-moving object. Cameras do create motion blurs automatically and unintentionally, but in Flash, you must put them in yourself.
A blur is an effect that occurs when the camera is out of focus. Blurs are particularly effective for transitions; you can animate a blurry image coming into sharp focus.
Creating Special Effects To create a motion blur:
Create the image to which you want to apply a motion blur, and convert it to a graphic symbol (Figure 1.47).
Figure 1.47 Create a graphic symbol. This snowboarder will be moving fast enough to cause a motion blur.
Copy the graphic, and paste it into a new document in Photoshop. The new Photoshop document should be at 72-dpi resolution and the same size as your copied Flash graphic. The Flash graphic appears in the Photoshop document.
Choose Image>Canvas Size. The Canvas Size dialog box appears.
Increase the canvas by about 150 percent in the direction in which you will be applying your motion blur (Figure 1.48); then click OK. The background of your graphic increases so that you have room for your motion blur (Figure 1.49).
Figure 1.48 In Photoshop, change the canvas size in the direction of the blur. This canvas will get wider on either side by 150%.
Figure 1.49 The image in Photoshop needs room on either side to make room for a horizontal blur.
Choose Filter > Blur > Motion Blur. The Motion Blur dialog box appears.
Change the angle of the blur to match the direction in which your image will be moving, and set the amount of blur to about one-fifth the overall size of your image (Figure 1.50); then click OK. The image becomes blurry in one direction only, simulating the speed streaks from a camera.
Figure 1.50 The Motion Blur filter in Photoshop provides options for the direction and amount of blur, as well as a preview window of the effect.
Choose Layer > Flatten Image (Figure 1.51).
Figure 1.51 In the Layers palette of Photoshop, flatten your image to a single layer.
Choose Select > All (Cmd-A for Mac, Ctrl-A for Windows), copy the image, and then paste it back into your Flash file in an empty layer. The motion-blurred bitmap image appears on the Stage and in your Library.
Convert the blurry bitmap image to a graphic symbol.
Move the blurry instance below the original Flash graphic so that the streaks extend in the opposite direction from which the graphic will move (Figure 1.52).
Figure 1.52 The motion blur is positioned behind the image of the snowboarder. Both instances are on separate layers, in preparation for motion tweening.
Create keyframes for both layers later in the Timeline, move both instances across the Stage, and apply a motion tween to both layers. The original image and the blurred image move together, but the combined effect isn't quite convincing yet.
Adjust the timing of the keyframes so that the blurred image starts a few frames later and the original image finishes a few frames earlier, and add an empty keyframe in the last frame for the blurred image (Figure 1.53). Having the blurred image lag behind the original graphic makes the streak more of an afterimage and completes the special effect.
Figure 1.53 Play with the timing of the motion tween of the blur so that it appears when the snowboarder is in motion but disappears when he stops.
This technique works only if your Stage is a solid color, because the Photoshop filter produces a bitmap that blurs the image to the background.
To create a blur-to-focus effect:
As in the preceding example, copy and paste an image from Flash into Photoshop.
Adjust the canvas in both width and height to make room for the blur effect. For an image that bleeds on all four sides like the example shown here, however, increasing the canvas size isn't necessary.
In Photoshop, choose Filter > Blur > Gaussian Blur. The Gaussian Blur dialog box appears.
Enter a pixel amount that determines the amount of blurring you desire (Figure 1.54); then click OK. The image blurs.
Figure 1.54 The Gaussian Blur filter in Photoshop makes the entire image unfocused.
Make sure to flatten the image by choosing Layer > Flatten Image.
Select the entire image; then copy and paste it back into Flash in an empty layer. This Flash file contains your original, focused image.
Convert the blurry imported bitmap to a graphic symbol.
Align the original, focused image and the blurry image, with the blurry image in the topmost layer (Figure 1.55).
Figure 1.55 Place the blurry instance over the original image. In this figure, the two images are not yet aligned, so you can see their overlapping positions.
Later in the Timeline, insert a keyframe into the layer that contains the blurry image.
In the last keyframe of the blurry image, change the image's alpha value to 0% (Figure 1.56). The blurry image in the last keyframe becomes transparent, exposing the focused image in the layer below.
Figure 1.56 In the Property Inspector, the alpha value of the top, blurry image is set to 0%, exposing the original, focused image in the bottom layer.
Apply a motion tween to the layer that contains the blurry image. As the blurry image slowly disappears, it shows the unaltered image, making it seem as though you have one image with a change in focus (Figure 1.57).
Figure 1.57 The result makes an effective transition.
Try increasing the initial size of the blurry image slightly to add a subtle zooming-in effect, which enhances the blur-to-focus transition.
You can use any Photoshop filter in this manner to create a transition.
Experiment with the numerous available filters to suit your movie.