Flash Tutorials: Gradient Bevel Filters & the ActionScript.

Home • Members Tutorials Forum iSnapChat Contact Us 

 


Flash Tutorials

   

Create Flash Gradient Bevel Filter with ActionScript

 

Free Flash Tutorial


Step 2    <<   Previous      Intro   1   2   3     Next   >>      

 

Step Two: The ActionScript

  1. In the Timeline insert a new Layer:
  2. Name the Layer: ActionScript
  3. Select Frame 1 of the Actionscript Layer: Frame 1
  4. Open the Actions Panel: Window > Actions (F9)
  5. If Script Assist is on, Switch it off:

    Note: With Script Assist on you cannot type in the Actions Panel. If you want to learn more about Script Assist see the tutorial on the Actions Panel

  6. Type (or paste) the following into the Actions Panel:

    // Makes the filter available to use in the Movie.
    import flash.filters.GradientBevelFilter;

    // The Arrays (lists) below must all have the same number of entries.
    // Lists the colors to use in the Gradient.

    var colors:Array = [0x990000, 0xFFFFFF, 0xFF99FF];
    // Sets the transparency of each color.
    var alphas:Array = [0.3, 1, 0.3];
    // Set the position of each color.
    var ratios:Array = [0, 100, 255];

    // Creates a variable with info about the Filter settings.
    var myGradientBevelFilter = new GradientBevelFilter (3, 225, colors, alphas, ratios, 8, 16, 6, 1, "inner", false);

    // Applies the filter to the object named myObject.
    myObject.filters = [myGradientBevelFilter];

    Note: It is possible to write this code in a more compact form. The Arrays do not need to be separated out but can be directly included in the parameter settings. I prefer to spread it out as it is easier to edit. But if you wish you could write the code like this:

    // Makes the filter available to use in the Movie.
    import flash.filters.GradientBevelFilter;

    // Creates a variable with info about the Filter settings.
    var myGradientBevelFilter = new GradientBevelFilter (3, 225, [0x990000, 0xFFFFFF, 0xFF99FF], [0.3, 1, 0.3], [0, 100, 255], 8, 16, 6, 1, "inner", false);

    // Applies the filter to the object named myObject.
    myObject.filters = [myGradientBevelFilter];

     

  7. Test your Movie: Control > Test Movie (Ctrl Enter)

         

Step 2    <<   Previous      Intro   1   2   3     Next   >>      


10268 visitors to this page since 25 March 07 •

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.