I’m trying to add a sprite to a stage made from bitmapData I link to from the library with the identifier pointerGraphic, here’s my code:
Pointer.as
package com.George.BMIapp
{
import pointerGraphic;
import flash.display.BitmapData;
import flash.display.Sprite;
import flash.geom.Rectangle;
import flash.display.Bitmap;
public class Pointer extends Sprite
{
const graphic:Bitmap = new Bitmap(new pointerGraphic(0,0));
private var _pointer:Sprite = new Sprite();
public function get sprite():Sprite
{
return this;
}
public function Pointer(y:int, minX:int, maxX:int)
{
_pointer.addChild(graphic);
addChild(_pointer);
_pointer.x = minX;
_pointer.y = y;
}
}
}
and I initialise it like so:
import com.George.BMIapp.Pointer;
//Constants for pointer movement
var POINTER_MIN_X:int = 68;
var POINTER_MAX_X:int = 283;
var heightPointer:Pointer = new Pointer(371, POINTER_MIN_X, POINTER_MAX_X);
Yet nothing appears on the stage, yet there are no errors (I’m in strict mode with debugging enabled).
I don’t know if your code is complete or not in the example, but for your pointer to show you need to add it to the stage. So it should be: