Mouse Movement Navigation
I am trying to make something in which where if the coursor is on the edges of the document, an object will move around. If the cursor is in the upper left corner, the object will both x and y values will be increased. This is what I have, but it does not work. I am not good at coding, and it has been some time. Also, if someone could help me simplify my code, that would be awesome.
//General Movement
if (mouseX<5)
{
if (example_mc.x<0)
{
example_mc.x = example_mc.x + 1;
}
}
if (mouseX>1020)
{
if (example_mc.x>-856)
{
example_mc.x = example_mc.x -1;
}
}
if (mouseY<5)
{
if (example_mc.y<0)
{
example_mc.y = example_mc.y + 1;
}
}
if (mouseY>760)
{
if (example_mc.y>-235)
{
example_mc.y = example_mc.y -1;
}
}