I want to detect when the mouse is pressed & held and hovered over a certain movieclip, let's call it "a"
How can I detect this action ?
Printable View
I want to detect when the mouse is pressed & held and hovered over a certain movieclip, let's call it "a"
How can I detect this action ?
import flash.events.MouseEvent;
var hold:Boolean;
stage.addEventListener(MouseEvent.MOUSE_MOVE, Controls);
stage.addEventListener(MouseEvent.MOUSE_DOWN, Controls);
stage.addEventListener(MouseEvent.MOUSE_UP, Controls);
function Controls(e:MouseEvent):void
{
switch(e.type)
{
case "mouseMove":
if(hold == true)
{
trace("hold = true");
if(a.hitTestPoint(mouseX, mouseY))
{
trace('is touching "a"');
}
}
break;
case "mouseDown":
hold = true;
break;
case "mouseUp":
hold = false;
break;
}
}