I currently have a maze made where my circle (instancename = Muis2) moves around when my mouse moves around. When it mouses over the walls of my maze (Instancename = Maze) I want the circle to move back to its beginning position (x = 908, y = 137). I can find all kinds of tutorials and Code Snippets, but none help me with my specific problem. This is probably because it shouldn’t be that difficult. I am just not that good at all this. I hope you can help me. The code I have until now is this.
stage.addChild(Muis2);
Muis2.mouseEnabled = false;
Muis2.addEventListener(Event.ENTER_FRAME, fl_CustomMouseCursor_2);
function fl_CustomMouseCursor_2(event:Event)
{
Muis2.x = stage.mouseX;
Muis2.y = stage.mouseY;
}
Mouse.hide();
Maze.addEventListener(MouseEvent.MOUSE_OVER, fl_MouseOverHandler_3);
function fl_MouseOverHandler_3(event:MouseEvent):void
{
trace("Moused over");
}
And it works if I add a trace code in the mouseover event. The only thing is that I need to add a custom code in the mouseover command so that when my circle (Muis2) mouses over my Wall it gets put back in the position where it came from. Hence, it needs to move to the position where it was (previous given x,y coordinates). I hope someone here can help me out! Thanks!