new Sprite() One-liner

var s:Sprite = Sprite(addChild(new Sprite()));

A way to make a new sprite, add it to the display list and store a reference to it.

Figured this out on my own… but have since seen it around on a few flash blogs here and there… thought it deserved a post.

Leave a Reply

Your email address will not be published. Required fields are marked *