How would I go about animating via Actionscript in Flash something like the following?:
I have several squares scattered on my stage with random Alpha values. When the movie loads, I'd like each square to smoothly animate to whatever their current alpha value is to zero, then to 1, and repeat the cycle indefinitely.
As a bonus, I'd like to be able to have each square stall for a period of time at alpha=1 before continuing to cycle.
I've gathered from an online tutorial that I should set up my square (ImageTile) as an object:
package {
import flash.display.*;
import flash.events.*;
public class ImageTile extends MovieClip {
var tileAlpha = this.alpha;
public function ImageTile() {
// construct here
this.addEventListener(Event.ENTER_FRAME, AnimateTile);
}
function AnimateTile(e:Event) {
// animation to go here
}
}
}
... but the math for what I want to do escapes me. Any help would be greatly appreciated!