Flash Burnin Effect

This is for a flash action script 2.0 file.
requires: http://laco.wz.cz/tween/to be installed to function
Note some aspects of this code:
– dynamically loads a directory full of images (jpgs specifically)
– fade aspects are definable.
– recursive function for looping through images.
– just a setInterval for the master loop.
#include "lmc_tween.as"
// Define a movie clip loader to load the images.
var mclLoader:MovieClipLoader = new MovieClipLoader();
var mcImage:MovieClip;
var fadeIn:Number;
var fadePause:Number;
var fadeOut:Number;
var fadeBetweenOut_In:Number;
var NumberOfImages:Number
var CycleTime:Number;
NumberOfImages = _root.number;
/* fadeIn = 1.5;
fadePause = 1;
fadeOut = 1.5;
fadeBetweenOut_In = 1;
*/
fadeIn = 1;
fadePause = 1;
fadeOut = 1;
fadeBetweenOut_In = 0;
mclLoader.addListener(oLoadListener);
for (var i = 1; i< =NumberOfImages; i++) { mcImage = this.createEmptyMovieClip("mcImage"+i, this.getNextHighestDepth()); mcImage.createEmptyMovieClip("mcFrame", mcImage.getNextHighestDepth()); mcImage.createEmptyMovieClip("mcHolder", mcImage.getNextHighestDepth()); mclLoader.loadClip( _root.section + i +".jpg", mcImage.mcHolder); mcImage._visible = false; mcImage._x=0; mcImage._y=0; // Create a new color object that targets the movie clip. Add the color // object as an element of the oColors associative array, using the // movie clip's instance name as the key. // oColors[mcImage._name] = new Color(mcImage.mcHolder); // When the user clicks on the movie clip, set the selected reference, } var i:Number = 1; function DelayFading(something:String):Void { for (var j = 1; j<=NumberOfImages; j++) { this["mcImage"+j]._visible = false; this["mcImage"+j].colorTransformTo(100, 255, 100, 255, 100, 255, 100, 00, 0, "easeOutSine", 0); } with (this[something]) { _visible = true; colorTransformTo(100, 00, 100, 00, 100, 00, 100, 00, fadeIn, "easeOutSine", 0); colorTransformTo(100, 255, 100, 255, 100, 255, 100, 00, fadeOut, "easeOutSine", fadeIn + fadePause); } }; CycleTime = (fadeIn + fadePause + fadeOut + fadeBetweenOut_In) * 1000; StartSlide(); hmm = setInterval(StartSlide(), CycleTime * NumberOfImages); function StartSlide(){ slideS(); argh = setInterval(slideS, _root.CycleTime); } function slideS(){ DelayFading("mcImage"+ i); i++; if (i > NumberOfImages) {
clearInterval(argh)
_root.i = 1;
};
}


Posted

in

by

Tags:

Comments

One response to “Flash Burnin Effect”

  1. Jon SEO Avatar

    Thanks mate, this is really useful. I love how you can still define fade with this code. Cheers
    Jon

Leave a Reply

Your email address will not be published. Required fields are marked *