OK, so you’ve been getting the hang of AS3 and you’ve abandoned MovieClip in favor of its lightweight cousin, Sprite. But don’t stop there. If all you need to do is draw some graphics with the drawing API, check into the Shape class.
Shape is also part of the flash.display package, and inherits from DisplayObject, so you create it and add it to the display list the same way:
[as]
var myShape:Shape = new Shape();
addChild(myShape);
[/as]
In fact, the only thing Shape seems to add to DisplayObject is the graphics property. So you can draw in it with the drawing API methods.
Note that it does not extend InteractiveObject or DisplayObject container, so you’re not going to get any mouse or keyboard events off it, and you can’t add any other display objects as children of the shape. But because of those limitations, its going to use less memory and probably take less cpu power.
The obvious use of Shapes is for component skins, but you can extend that to any graphical UI element. I’ve been playing around with some AS3 interface stuff and will post a nice example soon.
Gone are the days when you just used movie clips for everything!