ForumsProgramming ForumFlash As3 Problems MOUSE_OVER

6 4058
alsage
offline
alsage
132 posts
Nomad

So I have this problem... Its not an error but the problem is I need to do a mouse overlay and pretty much if your mouse hitTests into an object you goto frame 2... my error is if you move very slowly you are able to touch the object without going to frame 2... does anyone else have this problem or is it just me?

  • 6 Replies
manny6574
offline
manny6574
922 posts
Nomad

Hmm.. so do you use a MOUSE_OVER event listener or hitTests?

If event, then I there shoudn't be a problem.

If hitTest, is it hitTestObject or hitTestPoint?

alsage
offline
alsage
132 posts
Nomad

Hmmm... I use hitTestsPoint

stage.addEventListener(MouseEvent.MOUSE_OVER, detectHits_lvl1);

function detectHits_lvl1(event:MouseEvent) {

if (wall_mc.hitTestPoint(mouseX,mouseY,true)) {
gotoAndPlay(2);
stage.removeEventListener(MouseEvent.MOUSE_OVER, detectHits_lvl1);

}
}


do you think you could show me the code you would use for event listener?
manny6574
offline
manny6574
922 posts
Nomad

wall_mc.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);

function onMouseOver(e:MouseEvent){
wall_mc.removeEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
gotoAndPlay(2);
}

alsage
offline
alsage
132 posts
Nomad

ok Thanks for help =D and sorry I cant join your team I dont have the time

alsage
offline
alsage
132 posts
Nomad

so its still partially not working... I found out why its not causing it, my cursor.


stage.addEventListener(MouseEvent.MOUSE_MOVE,CursorFollowMouse_lvl1);
function CursorFollowMouse_lvl1(e:MouseEvent):void
{
Mouse.hide();
Cursor.x = mouseX;
Cursor.y = mouseY;
}


is that right?
TehCodr
offline
TehCodr
3 posts
Nomad

just create a button, double click it, and change it in the frame titled Mouse Over

Showing 1-6 of 6