Macromedia Flash Professional 8 Unleashed
Authors: Vogeleer D. Wilson E. Barber L.
Published year: 2005
Pages: 16-19/319
Buy this book on amazon.com >>

Filters

Much like blend modes, filters will not be new to Photoshop users, but they are new to Flash. Filters allow things such as drop shadow, blur, and beveling to be applied directly to a movie clip, a button, or a text field right from the Filters panel, which is held in Properties Inspector (Flash Professional 8 only). You can also have multiple filters applied to a single object and stack them in different orders to get different effects.

You can see the Filter panel options for the Drop Shadow filter in Figure 1.10. Notice that you can not only adjust the filter, but also how the object interacts with the filter. For instance, you can check the Knockout option, and the filter will remain , but the object on the stage will have vanished.

Figure 1.10. The Filters panel, for applying visual effects to objects on the stage.


Following is a list of all available filters:

  • DropShadow Adds a drop shadow to an object, inner or outer.

  • Blur Adds a blur effect to an object.

  • Glow Adds a glow to an object, inner or outer.

  • Bevel Adds a simple bevel to an object.

  • GradientGlow Adds a gradient glow to an object, inner or outer.

  • GradientBevel Adds a gradient bevel to an object.

  • AdjustColor Allows you to adjust the Brightness, Contrast, Saturation, and Hue of an object.

Even more options are available when you apply filters to objects with ActionScript, as you will see in Chapter 13.



Stroke Improvements

There has also been a great deal of improvement made to creating lines in Flash. You can now have gradients on lines, whether they are drawn manually or created with ActionScript.

Another improvement for lines is their ends. You can now set the line ends (caps) to either None, Round, or Square. You can also set how lines embedded into movie clips will scale with the following options:

  • Normal Always scale the thickness of the line. This is the default choice.

  • Horizontal Do not scale the thickness of the line when the line is horizontally scaled.

  • Vertical Do not scale the thickness of the line when the line is vertically scaled.

  • None Never scale the thickness of the line.



Video in Flash

Although video is discussed on more than one occasion throughout this book, it is important to note a major improvement for video in Flashthe alpha channel.

Now Flash can import, convert to FLV, and play back video with an alpha channel, allowing developers and designers to quickly add video to their Flash content and still be able to see what is behind the video.

As you can see in Figures 1.11 and 1.12, both use the same video, yet have different backgrounds. This was easily done because the video itself has the background taken out.

Figure 1.11. You can see the woman walking in front of platform 9 3/4.


Figure 1.12. This time, the woman is walking in front of a text field, with highlighted text, which means the user is interacting with it as the video plays.


Again, video is covered in more detail in Chapter 6, "Working with Sound and Video," and Chapter 26, "Streaming Media."

Do not think ActionScript was forgotten; there are several new Object classes, and we will go over a few of them. But for more information on the new objects, check out the reference section at the end of the book.



New Dynamic Content

In previous versions of Flash, the only visuals that could be loaded in at runtime were nonprogressive JPEGs and SWF files. Now you can import GIFs, PNGs, and progressive JPEGs in the same manner as in previous versions of Flash. When you import any of these image types with transparency, the transparency will be maintained .

Following is an example of loading a progressive JPEG as a background image and then loading a PNG image over top of it.

You can use any images you like, or grab the ones from the website.

1.

Create a new Flash document.

2.

In the first frame, open the Actions panel (Window, Actions) and place this code in it:

//create the two movieclips to hold the images
var image1:MovieClip = this.createEmptyMovieClip("image1_mc",1);
var image2:MovieClip = this.createEmptyMovieClip("image2_mc",2);
//now load the first image
image1.loadMovie("mountains.jpg");
//then, when the user clicks the stage, the second image will load
this.onMouseDown = function(){
    image2.loadMovie("atSign.png");
}

The preceding code first creates two empty movie clips to house the images you are loading. Then you load the background image into the first movie clip. After that, you create an event so that when a user clicks the mouse on the stage, the second image will load.

Test this movie, and you should see something like Figure 1.13. Notice that the transparency of the second image is maintained.

Figure 1.13. Flash can load in transparent PNGs at runtime.



Macromedia Flash Professional 8 Unleashed
Authors: Vogeleer D. Wilson E. Barber L.
Published year: 2005
Pages: 16-19/319
Buy this book on amazon.com >>