# Bitmaps

**URL:** <https://forum.kirupa.com/t/bitmaps/303772>\
**Category:** Uncategorized\
**Created:** [January 26, 2010, 8:29pm UTC](https://forum.kirupa.com/t/bitmaps/303772 "2010-01-26T20:29:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maqrkk](https://avatars.discourse-cdn.com/v4/letter/m/35a633/32.png) [@Maqrkk](https://forum.kirupa.com/u/Maqrkk)\
**Post date:** [January 26, 2010, 8:29pm UTC](https://forum.kirupa.com/t/bitmaps/303772/1 "2010-01-26T20:29:46Z")

</div>

Hello all,

this technically probably isn’t a Flex question, but I’m using FlashDevelop, and thus the [Embed] tag, which isn’t used by CS4.

I’ve got a Tile object, that can have 4 different colours. I’ve got 4 .png images that each represent one of the colours. What’s the best way to go about this? Does it make any difference if I make 4 seperate classes that each reflect a Bitmap with the colour, or just Embed all 4 images in the Tile object, and then decide which to display?

This is how I’ve got it set up currently:

In tile.as:

```auto
switch(this.type)
{
	case "Red":
		graphic = new RedTile;
		break;

```

etc.

And this is how my RedTile class looks:

```auto
package game 
{
	import flash.display.Bitmap;

	public class RedTile extends Bitmap
	{
		[Embed(source = '../../lib/red.png')]
		private var Graphic:Class;

		public function RedTile()
		{
			var pic:Bitmap = new Graphic();
			this.bitmapData = pic.bitmapData;
			pic = null;
		}
	}
}

```

Is this a good way of doing it, or would you recommend I take a different path? Thanks in advance.
