So now I have another issue :3 This code down here does make the character rotate, but he rotates like a weirdo. If you want to see how he rotates go here:[url=http://megaswf.com/serve/1131412]
With just looking at your code, i can tell your trying to have him rotate towards your mouse. If he is flipping weirdly, what you have to do is go to your library, edit the symbol, and if you see in the center, there is a little circle (your person is usually to the bottom right of that). That circle is the point of rotation (the point its rotating from), so if its not directly on your symbol, its not going to rotate correctly. What you do is move him to the middle, but this isn't fully accurate. Go to properties, take the characters height and divide it by 2, then subtract that from the characters Y position. Then do the same with the width and the X position. This should put the character in the absolute middle.
Is there any other way to change the dot? There isn't just one center point in my character. Every part of his body is separated because they all react differently to what happens in the game :/
I just want to say, that dot is the registration point. When you set an movieclips X to 100, that point is what is placed at 100, not the movieclip. If the movie clip is to the bottom right of that, it will be placed with an offset to 100.
@Driejen Your code comes up with some weird output about things being null.
Mine has no problems at all. And you are going to have to be more specific if you want it fixed. Also changing the registration point isn't going to fix your rotation. Sure the center point seems a little off your characters head but it's not like it is orbiting an empty space when rotating.
The problem is that when your mouse is to the left of the character, its rotation is offset by an amount compared to when your mouse is to the right of the character. Hence why I added the line; if(dx<0) character.rotation += 180;
I must have inserted the code incorrectly. Now it does a full turn, but it does not face the mouse. For example if I have my cursor on the right side of the character it looks down.
It depends on where your character is facing when the angle is 0, on my example it started facing up so I have a +90, you will have to adjust it. In your case you must have started with the character facing right at 0 degrees? remove the +90.