Thanks @noel for reply. Oke maybe I’m to shy to much talk… because my native not english, and my english very bad
here the probleme…
I have class DragEntity here the code :
private var holderX:int;
private var holderY:int;
private var drag:Boolean = false;
public function DragEntity(posX:int, posY:int, gambar : Image)
{
super(posX, posY);
graphic = gambar
setHitboxTo(graphic);
}
override public function update():void
{
super.update();
if (collidePoint(x, y, world.mouseX, world.mouseY) && Input.mousePressed)
{
holderX = x - world.mouseX;
holderY = y - world.mouseY;
drag = true;
world.bringToFront(this);
}
if (drag)
{
x = holderX+world.mouseX;
y = holderY+world.mouseY;
}
if (Input.mouseReleased)
{
drag = false;
world.sendToBack(this);
}
}
and world class
override public function begin()
{
add(new DragEntity(120, 120, red));
add(new DragEntity(120, 120, blue));
add(new SlotEntity(240, 240));
}
I just want drag the Red, what should i do??? So, when I drag the drag entity, only red will moving.