Tutorial: A Simple script to create a random flicker

September 26, 2007

To set this up , create a movieclip on stage and give it an instance name of myCoverUp. The script below, declares a variable on the main timeline so it can be used outside the scope of the function flicker(). Then the function flicker chooses a random number between 0-50, toggles the visibility of myCoverUp, then clears and creates a new interval timer using the random number as a delay.

var nextInterval = 100;
flickerInterval = setInterval(flicker, nextInterval);
function flicker(){
    nextInterval = Math.random() * 50;
    myCoverUp._visible = !myCoverUp._visible;
    clearInterval(flickerInterval);
    flickerInterval = setInterval(flicker, nextInterval);
} 
...
Read More >>

Rounding to a multiple of a number

July 31, 2007
...
Read More >>

Tutorial: Creating a Timeline scrubber.

July 14, 2007
Build a MovieClip that controls the Timeline position of another MovieClip. ...
Read More >>

Tutorial: Two Methods to Make a Countdown Timer

June 12, 2007
Setting up a countdown timer can be helpful in a number of situations, particularly in situations that have a time limit. ...
Read More >>

Tutorial: Drag and throw an object on stage.

June 07, 2007
In this tutorial we will build a movie that contains a simple movieclip that allows the user to click and drag the clip, and when released exhibits some inertia and continues to move and bounce off walls like an air hockey puck. ...
Read More >>

Tutorial: Create an XML Driven, Cross-fading Slideshow

June 05, 2007
This tutorial will teach you how to create a simple timed, cross-fading photo album. The basic principles here can be used to expand this project into something far more impressive, but my goal is just to introduce some of the concepts and leverage a bit of their power. ...
Read More >>
<< Previous