I should re-word my statement. I defined it but with a static initialization which I am not ENTIRELY sure is correct:
This is the item class which was provided to me by Raptor:
package {
import flash.display.BitmapData;
import flash.display.Graphics;
import net.flashpunk.FP;
public class Items
{
public static const ITEM_TYPE_NONE:int = 0;
public static const ITEM_TYPE_CHERRY:int = 1;
public static const ITEM_TYPE_LIME:int = 2;
public static const ITEM_TYPE_BLUEBERRY:int = 3;
public static const ITEM_TYPE_COUNT:int = 4; // Last one
public static const itemNames:Vector.<String> = Vector.<String>(["Nothing", "Cherry", "Lime", "Blueberry"]);
public static var pickupsBmp:BitmapData;
public static var inventoryBmp:BitmapData;
//Static initialization code to create graphics
{
var g:Graphics = FP.sprite.graphics;
// Create dots for pickups
pickupsBmp = new BitmapData(32 * 4, 32, true, 0);
g.clear();
g.beginFill(0xFF0000); g.drawCircle(32 * 0 + 16, 16, 16); g.endFill();
g.beginFill(0x00FF00); g.drawCircle(32 * 1 + 16, 16, 16); g.endFill();
g.beginFill(0x0000FF); g.drawCircle(32 * 2 + 16, 16, 16); g.endFill();
pickupsBmp.draw(g);
// Create rectangles for inventory
inventoryBmp = new BitmapData(32 * 4, 32, false /*true*/, 0);
g.clear();
g.beginFill(0xFF0000); g.drawRect(32 * 0, 0, 32, 32); g.endFill();
g.beginFill(0x00FF00); g.drawRect(32 * 1, 0, 32, 32); g.endFill();
g.beginFill(0x0000FF); g.drawRect(32 * 2, 0, 32, 32); g.endFill();
pickupsBmp.draw(g);
}
}}