Pure code AS3 spinning loading animation
While working on the video player, I wanted to show spinning loading animation while buffering, and since I decided that the whole thing will be pure code, with no library assets, I had to code this animation – just the kind of things I like.
It didn’t take long, and I decided to share it – why not?
So here it is:

What you need to do in order to use it is add two functions:
import LoadAnim;
...
private var myAnim :LoadAnim;
...
public function showAnim():void
{
myAnim = new LoadAnim(0x333333); // animation color
myAnim.x = stage.stageWidth / 2;
myAnim.y = stage.stageHeight / 2;
addChild(myAnim);
}
public function hideAnim():void
{
myAnim.stopAnim();
removeChildAt(1);
}
Download the class here, enjoy : )

Great, Thank you!
thanks… exactly what I was looking for… changed the implementation functions so implementation is a little easier (for others that are copying and pasting)
public function showAnim(_x=stage.stageWidth / 2,_y=stage.stageHeight / 2):void
{
myAnim = new LoadAnim(0×333333); // animation color
myAnim.name=”myAnim”;
myAnim.x = _x;
myAnim.y = _y;
addChild(myAnim);
}
public function hideAnim():void
{
myAnim.stopAnim();
if(myAnim!=null && contains(myAnim))
{
removeChild(getChildByName(“myAnim”));
}
}
Cool, thanks Andy
thanks a lot