This content has been marked as final. Show 4 replies
Not really sure what you are talking about I don't get any of the behaviors you are talking about.
Your code should give the position when the mouse button goes down and again when the mouse button goes up. The down and up should be the same only if you don't move the mouse.
If you left click and hold the button and move the mouse the down and up will not be the same and the trace reflects that.
However when I right click I get no traces at all.
I am on a Mac so perhaps the player handles right clicks for the Mac differently.
But in any event there is absolutely nothing wrong or unexpected about the results of this code. Why do you thing they should be the same? That is a wrong assumption.
Rothrock, thanks for replying.
You might misunderstand my meaning. To reproduce the problem I described:
1. Run the code in Flash
2. Press the RIGHT button of mouse, it should bring up the context menu (not sure about Mac)
3. Move your mouse to somewhere else
4. Press the LEFT button of mouse and release immediately, that is, a CLICK
5. You should be able to see the different poistion for MouseDown and MouseUp, which was expected to be the same
I'm pretty sure I do understand. But on my Mac I'm not seeing any traces at all for the right click followed by the left click. So I can't really test it all out.
However since you mentioned in the part about the left click that you expected them to be the same – which isn't necessarily true – I thought you might be assuming things you shouldn't.
In any event I think you can find that the behaviour is even odder than you expected when you take into account the Mac platform strangeness.
Is there a reason you attached this to an object and then added a listener? Why not just attach it to a movieclip or root. That might work differently/better. Maybe?
I've tried to use onClipEvent(mouseDown/mouseUp), and get the same result. My situation is: compare the mouse positions of MouseDown and MouseUp, if they are same, it is click action, else a drag. They lead to different result in my program. At the same time, there are some custom context menus in the Flash. It is possible for the users to show it but abort a selection.