Creating Filters with ActionScript

Home • Members Tutorials Forum iSnapChat Contact Us 

 


Flash Tutorials

   

Click by Click: Creating Filters with ActionScript

See Full Version: This is a shortened click by click version of a: Full Length Tutorial


 

Free Flash Tutorial

 

 

: The flash.filters Package

 

Flash 8 Professional come with a set of filters that apply rich visual effects. These Flash Filters are similar to those in graphics programs. All the filters can be customised in many ways giving you control of the look and feel of the filters. The filters include Drop Shadow, Blur, Glow, Bevel, Gradient Glow, Gradient Bevel and Adjust Color. All these filters alter what an object looks like.

 

Here is an example of what you will create in this tutorial:

Example: Download the Flash file Draw 211a

 


Movie Clip with Glow Filter applied.

Important Note: These Filters only work in Flash Professional 8. The filters are not available in Flash 8 Basic or any of the earlier versions of Flash such as Flash MX04/MX/5.


Step One: Setting up the Document

  1. Open a New Flash Document: File > New (Ctrl N)
  2. If the General Tab is not selected, select it:
  3. Select Flash Document:
  4. Click: OK
  5. Go to: File > Publish Settings
  6. If the Flash Tab is not selected, select it:
  7. For Version select: Flash Player 8
  8. For ActionScript version select: ActionScript 2
  9. Click: OK

 

Step Two: Creating an Object

  1. Select the Rectangle Tool: (R)
  2. Drag out a: Rectangle
  3. If the Property Inspector is closed, open it: Window > Properties > Properties (Ctrl F3)
  4. Double click in the centre of the rectangle to: Select the Rectangle
  5. Change any of the rectangles properties as appropriate: Change Properties
  6. With the rectangle still selected go to: Modify > Convert to Symbol (F8)
  7. For Name type: myMovieClip
  8. For Type select: Movie Clip
  9. Click: OK
  10. If the Property Inspector is closed, open it: Window > Properties > Properties (Ctrl F3)
  11. With the rectangle still selected type an Instance Name: myMovieClip


Step Three: The ActionScript

  1. If the Timeline is closed, open it: Window > Timeline (Ctrl Alt T)
  2. Rename Layer 1 to: Rectangle MC
  3. Insert a new Layer:
  4. Name the Layer: ActionScript
  5. Select Frame 1 of the Actionscript Layer: Frame 1
  6. Open the Actions Panel: Window > Actions (F9)
  7. If Script Assist is on, Switch it off:
  8. Type the following into the Actions Panel (further explanation is given in the next section):
  9. // Makes the filter available to use in the Movie.
    import flash.filters.GlowFilter;

    // Creates a variable with info about the Glow Filter settings
    var myGlowFilter = new GlowFilter (0xff00ff,1,25,25,2,3,false,false);

    // Applies the filter to the object named myMovieClip
    myMovieClip.filters = [myGlowFilter]

  10. Test your Movie: Test > Movie (Ctrl Enter)
  11. Close the Test Window:

 

See Full Version of this: Tutorial


5289 visitors to this page since 20 June 06

Phil Schulz's Facebook Profile
Webwasp is Phil Schulz's baby. You are welcome to contact me or become my Facebook friend: Click here

 Top of Page HomeMembers Tutorials Forum iSnapChat Contact Us 
 All material on this site is protected under international copyright © law. DO NOT reproduce any material from this site without written permission. Please ask as permission is often granted.