I'm really new to AS3, and I'm wondering how to make a sprite animation from a sprite sheet I have in the library.
I used:
Code:
var spriteSheet:SpriteSheet= new SpriteSheet(2016,1920);
To get the bitmapData from the library, then:

Code:
var col:uint = 0;
var row:uint = 0;

//In a function called on the EnterFrame event:
var tempBitmapData:BitmapData = new BitmapData(96,96);
tempBitmapData.copyPixels(spriteSheet,new Rectangle(col*96,row*96,col*96+96,row*96+96),new Point(0,0));
var tempBitmap:Bitmap = new Bitmap(tempBitmapData);
stage.addChildAt(tempBitmap,0);
How do I make it so that the bitmap and bitmapData from the previous frame is deleted from memory? I need to display a new 96x96 piece of the sprite sheet on every frame. (col and row are incremented on each frame).

Thanks.