I’m working on a ACAD flash system, and one of the functions is to draw lines. Now I’d like to be able to draw vertical/horizontal lines by holding a key down (i.e. Shift). But I’m finding that the system is detecting me releasing the mouse (I’m not) while I hold another key.
Attached is a .fla file where you can click and drag a box.
Don’t worry about posting “oh you should use startDrag()” and whatnot. The architecture of the actual application makes such things not feasible. This is just a test .fla.
The code is here:
ActionScript Code:
[FONT=Courier New][LEFT][COLOR=#0000FF]on[/COLOR] COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#0000FF]this[/COLOR].[COLOR=#0000FF]onMouseMove[/COLOR] = [COLOR=#000000]function[/COLOR]COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#0000FF]trace[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]‘Mouse is moving’[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#0000FF]this[/COLOR].[COLOR=#0000FF]_x[/COLOR] = [COLOR=#0000FF]_root[/COLOR].[COLOR=#0000FF]_xmouse[/COLOR];
[COLOR=#0000FF]this[/COLOR].[COLOR=#0000FF]_y[/COLOR] = [COLOR=#0000FF]_root[/COLOR].[COLOR=#0000FF]_ymouse[/COLOR];
[COLOR=#000000]}[/COLOR];
[COLOR=#000000]}[/COLOR]
[COLOR=#0000FF]on[/COLOR] COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#0000FF]this[/COLOR].[COLOR=#0000FF]onMouseMove[/COLOR] = [COLOR=#000000]null[/COLOR];
[COLOR=#0000FF]trace[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]“Mouse released”[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR]
[COLOR=#0000FF]on[/COLOR] COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#0000FF]this[/COLOR].[COLOR=#0000FF]onMouseMove[/COLOR] = [COLOR=#000000]null[/COLOR];
[COLOR=#0000FF]trace[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]“Mouse released”[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR]
[/LEFT]
[/FONT]
So yeah, as you run it and drag the object around, you see a lot of “Mouse is moving”, but if you press and hold any key, you’ll also notice the “Mouse released” as well.
Thoughts?