startDrag movie Clip disapears
I'm making a game where I have units that can move from square to square kind of like a game of risk but with squares. I want the units to be able to be dragged from one square to another. When I use the startDrag function on my unit it disapears.
public function Unit(mainMC:MovieClip){
mainClip = mainMC;
addEventListener(MouseEvent.CLICK, clicked);
addEventListener(MouseEvent.MOUSE_DOWN, heldDown);
addEventListener(MouseEvent.MOUSE_UP, released);
}
//this is in Worker which extends Unit
override public function heldDown(e:Event):void{
var posX = currentSquare.x - currentSquare.width;
var posY = currentSquare.y - currentSquare.height;
var w = currentSquare.width * 3;
var h = currentSquare.height * 3;
startDrag(false, new Rectangle(posX, posY, w, h));
}
so my workers show up in the square just fine. they just disapear when I drag them. some other minor details are:
everything is in a big main MovieClip, class Square extends MovieClip and there is a .jpg on the bottom on the main MC. so the child level order is .jpg, then Squares, then the squares have Units (if they have units). Units are added to the Squares not the main MC
any help would be great