Hey, I’m having a problem when detecting the direction of the mouse.
I’m using the following script:
[COLOR=#0000ff]stop[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#808080]*//*[/COLOR]
[COLOR=#000000]**var**[/COLOR] old_x:[COLOR=#0000ff]Number[/COLOR] = [COLOR=#0000ff]this[/COLOR].[COLOR=#0000ff]_xmouse[/COLOR];
[COLOR=#000000]**var**[/COLOR] old_y:[COLOR=#0000ff]Number[/COLOR] = [COLOR=#0000ff]this[/COLOR].[COLOR=#0000ff]_ymouse[/COLOR];
[COLOR=#808080]*//*[/COLOR]
[COLOR=#000000]**function**[/COLOR] getDir[COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR]:[COLOR=#0000ff]Void[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#000000]**var**[/COLOR] new_x:[COLOR=#0000ff]Number[/COLOR] = [COLOR=#0000ff]this[/COLOR].[COLOR=#0000ff]_xmouse[/COLOR];
[COLOR=#000000]**var**[/COLOR] new_y:[COLOR=#0000ff]Number[/COLOR] = [COLOR=#0000ff]this[/COLOR].[COLOR=#0000ff]_ymouse[/COLOR];
new_x > old_x ? [COLOR=#0000ff]trace[/COLOR][COLOR=#000000]([/COLOR][COLOR=#ff0000]"moving right"[/COLOR][COLOR=#000000])[/COLOR] : [COLOR=#0000ff]trace[/COLOR][COLOR=#000000]([/COLOR][COLOR=#ff0000]"moving left"[/COLOR][COLOR=#000000])[/COLOR];
new_y > old_y ? [COLOR=#0000ff]trace[/COLOR][COLOR=#000000]([/COLOR][COLOR=#ff0000]"moving down"[/COLOR][COLOR=#000000])[/COLOR] : [COLOR=#0000ff]trace[/COLOR][COLOR=#000000]([/COLOR][COLOR=#ff0000]"moving up"[/COLOR][COLOR=#000000])[/COLOR];
old_x = new_x;
old_y = new_y;
[COLOR=#000000]}[/COLOR]
[COLOR=#808080]*//*[/COLOR]
[COLOR=#0000ff]this[/COLOR].[COLOR=#0000ff]onMouseMove[/COLOR] = getDir;
But for some reason I’m not getting any output. Any help would be much appreciated.
Thanks.