Dynamic Flickering Effect
Category: Adobe Flash Tutorials
Added: 05/20/2007
Views: 98,445
Category: Adobe Flash Tutorials
Added: 05/20/2007
Views: 98,445
To code dynamic flickering that can be applied to any MovieClip object in Adobe Flash. The flicker intensity, time between flickering and duration can be easily adjusted by changing variables. It is a great effect to draw attention to particular elements of your interface. As a example, I will apply the effect to the Neon Sign created in the last tutorial.
If you don't have an idea yet for a Movieclip to apply the effect to, we will apply the effect to a neon sign creating the illusion that the sign is struggling to stay on. Here are links to the two graphics:
Neon Sign On
Brick Wall
If you do have your own idea, skip to step 3.
Open Adobe Flash and Modify the Document Properties.
Modify > Document
Size: 390 x 250 (Size of my example graphics)
Frame Rate: 30 fps
Background: White
Import the supplied sign_off.jpg onto the Stage.
File > Import > Import to Stage...
With the image selected use the Align Pane to position it on Stage. Make sure the "To Stage" button is down, then click the two align options below:
Window > Align

In the Timeline Pane, rename 'layer 1' to 'Brick Wall'.
Create 1 new layer by clicking Insert Layer,
.
Rename the new layer 'Neon Sign', see below:

Import the supplied sign_on.jpg onto the Stage.
File > Import > Import to Stage...
With the On Neon Sign selected, convert it into a MovieClip symbol.
Modify > Convert to Symbol
Name: Neon_Sign

Double click the Neon Sign MovieClip
In the Timeline Pane, rename 'layer 1' to 'Neon Sign'.
Create 1 new layer by clicking Insert Layer,
.
Rename the new layer 'Actionscript', see below:

It's already time to code the Flicker effect. The basic idea is to alternate the MovieClip between two different alpha settings. The rest is making the effect dynamic by randomizing the times in which the MovieClip will flicker.
Select Frame 1, labeled "Actionscript", on the Timeline inside the Movieclip you want to flicker and open the ActionScript Window.
Window > Actions
Copy & Paste the following code: ( All explained in my comments )
Change the "Neon_Sign" MovieClip to anything and it will flicker to your settings. It's a great effect to draw attention to interface elements.
I am a professional freelance web developer & graphic designer. These tutorials are a small sample of what I'm capable of. Check out my client portfolio and feel free to contact me. Whether it's a full blown database driven web application or simply a flashy banner design, hire a professional.
Interactive Trail Map Directory
Discovering trails in Maine just got a lot easier!
"Our organization relies on Pixel Hive Design’s broad-based expertise in web, graphic, and database design. Simple web sites, interactive atlases, custom Google Maps applications, brochures, interpretive panels…Pixel Hive Design has helped us to deliver wide-ranging, high quality products that always exceed clients’ expectations. Max is extremely talented and a great partner."
- Stephen Engle, Director, Center for Community GIS