Warning: A non-numeric value encountered in /homepages/10/d677520614/htdocs/ryanragle.com/wp-content/themes/Divi/functions.php on line 5560

Please Wait flash animation source

Sometimes you need to preload images, movies, data etc. in a flash project. There are a lot of progress indicators and what not, but the Apple progress animation is one of my favorites. For anyone that wants a very lightweight ActionScript 3 version of this animation you can download the source here.

There’s not a whole lot to it, but rather, just a for loop to cycle the opacity of the bar indicators.

var waitSteps:uint = 12;
var maxValue:uint = 100;
var minValue:uint = 10;
var startPosition:uint = 12;
this.addEventListener(Event.ENTER_FRAME, onEnterFrame);
function onEnterFrame(e:Event) {
for(var i:int=0; i<waitSteps; i++) {
this[“mcWP” + startPosition].alpha = (i * ((maxValue – minValue) / (waitSteps – 1))) / 100;
if(startPosition >= waitSteps){
startPosition = 1;
} else {
startPosition++;
}
}

if(startPosition >= waitSteps){
startPosition = 1;
} else {
startPosition++;
}
}