motion graphics eXchange

Flickering Neon Light

Thumbnail for: Flickering Neon Light
This expression creates a flickering effect on a layer - similar to a flickering neon light.
After Effects CS3

Views: 26976
visit |  share this  error? 
It is applied to the OPACITY of the layer. It picks a random number for the opacity value the layer only some of the time, based on whether another random number ("probability") is less than or equal to 1. You can change the likelyhood of a random opacity being selected by changing the value of "probability."

The rest of the time the opacity is set to the value of "opacity_normal" which is set to 100 by default.

This concept be easily adaptable to other times when you only want something to happen some of the time by using the if...else operators. For example - you could apply something similar to the position or rotation of a layer and it would hop around some of the time.
//applyTo: opacity
// HIGHER values for probability make a random opacity LESS likely.
// A value of 1 will always create a random opacity, a value of 2 will
// create a random opacity 50% of the time, value of 4 will be 25%, etc.

probability = 6;
// "opacity_normal" is the value set for opacity when the a random opacity is NOT chosen.
opacity_normal = 100;
x = random(probability);
if (x <= 1) {
   opacity = random(100);
} else {
opacity = opacity_normal;
Nathan Shipley
Animator, IMS Productions

(Min. Version: After Effects CS3, Category: Lights, Type: Expressions)
posted by MicGyver on Mar 08, 2010


Related topics:

Folding Template

Thumbnail for: Folding Template
folding and unfolding template free to use.
Require After Effects CS6
After Effects CS6
Projects (aep)

Views: 33954
posted by fsimoni on Nov 05, 2012

Product, Service or App Promotion

Thumbnail for: Product, Service or App Promotion
After Effects Template. Promote your app, product or service
After Effects CS5
Useful things
Projects (aep)

Views: 16266
posted by RedSpikeFx on Oct 30, 2012

Clean Logo V2

Thumbnail for: Clean Logo V2
After Effects CS4,CS5,CS5.5 and CS6 template logo reveal
After Effects CS4
Projects (aep)

Views: 20449
posted by aedaddy on Aug 19, 2012



follow us on in touch on facebook



Full length video training series presented by motion graphics industry professionals. Click here to visit Motionworks website!