Macromedia Flash - Apply Glow effects to images with AS code
In this article we will look at how to apply Glow filter to any image using the AS code. You can use this effect for some flash buttons or banners . Through this lesson, you will learn how to convert any image into a Movie Clip Symbol, how to give permission to execute a code on it and many other tricks.
Step 1
Create a new flash document. Press Ctrl + J key on the keyboard ( Document Properties ) and set your Frame rate to 30 and click OK .
Step 2
Now select File > Import > Import to Stage ( Ctrl + R ) and import any image into the flash stage.
Step 3
While the image is still selected, press F8 key ( Convert to Symbol ) to convert it into a Movie Clip Symbol
Step 4
While the newly created movie clip is still selected, go to the Properties Panel below the stage. In the left pane, you will see the Instance name field, name this Movie Clip image as shown below:
Step 5
Call the current layer image. Double-click on its default name ( Layer 1 ) to rename it. Press Enter when you have finished typing the new name.
Step 6
Create a new layer above the layer image and name it action
Step 7
Select the first frame of layer action and go to the Action Script Panel ( F9 ). Then, enter this code in the actions section:
import flash.filters. *;
var gf: GlowFilter = new GlowFilter (0x70A146, 15, 18, 14, 3, 3, true, false);
var ds: DropShadowFilter = new DropShadowFilter (2, 35, 0x70a146, 5, 5, 5, .8, 3, false, false, false);
image.filters = [gf, ds];
image.onRollOver = function () {
this.onEnterFrame = function () {
gf.blurX + = (80-gf.blurX) / 5;
gf.blurY = gf.blurX;
image.filters = [gf, ds];
};
};
image.onRollOut = function () {
this.onEnterFrame = function () {
gf.blurX + = (20-gf.blurX) / 5;
gf.blurY = gf.blurX;
image.filters = [gf, ds];
if (gf.blurX <21) {
delete this.onEnterFrame;
}
};
};
Check your movie now ( Ctrl + Enter )
Good luck!
You should read it
- Macromedia Flash - Create banner text effect
- Macromedia Flash - Text display effect
- Macromedia Flash - Vivid photo effects
- Macromedia Flash - Create menu effects
- Macromedia Flash - Product image advertising effects
- Macromedia Flash - Advanced masking with action script
- How to use Photoshop CS5 - Part 12: Create Light and Glow effects
- Macromedia Flash - Effects with the cube
May be interested
- Macromedia Flash - Text display effectthis lesson will show you how to create a very nice text effect that can be used in some banner effects, advertisements, and presentation files ...
- Macromedia Flash - Effects of changing position of textthis tutorial will show you how to create a constantly changing text effect in flash using the action script.
- Macromedia Flash - Effect of 'oil spill'through this tutorial you can make an effect for small ads that are quite simple but no less strange ...
- Macromedia Flash - Water bubble effectcarefully watching this detailed tutorial will know how to create an extremely unique and funny effect with water bubble images using motion guide.
- Macromedia Flash - Automatically copy images in flash workspacein this article, i will show you how to import any image into the flash workspace and then copy it multiple times using a small piece of code.
- Macromedia Flash - Create analog clock in Flashthis tutorial will show you how to create a real working clock using flash effects.
- Macromedia Flash - Create flash menu with soundin this flash tutorial, we will guide you to create a dynamic flash menu with sound. you can use this menu on any website.
- How to use Photoshop CS5 - Part 12: Create Light and Glow effectsin the following article, we will continue to show you the basic steps for creating and applying light and glow effects in photoshop. and when completing these steps, we will easily create some nice effects like smoke, subtle curves, stars and sparkling light ...
- Macromedia Flash - Running text effectwith just a few simple steps you can completely create a seemingly complicated effect. you can apply this lesson as a text effect for some advertising banners or slideshows.
- Macromedia Flash - Visual effects using mouse clickin this article we will step by step learn how to create visual effects using mouse clicks. you can use these effects for flash banners, for some presentations