I’m doing this to render two identical ships:
[Embed(source = "ship.png")]
public var ShipBitmap:Class;
var ship1:Sprite = new Sprite();
ship1.addChild( new ShipBitmap() );
var ship2:Sprite = new Sprite();
ship2.addChild( new ShipBitmap() );
Is this the recommended way, or am I wasting memory in any way? It feels unnecessary to create two ShipBitmaps. Also, I’m a bit unsure about using a sprite just for the container.
You can share a single
BitmapDatainstance and use this instance in differents contexts.Here is a quick example :